Re: [mediacapture-main] Should devicechange fire when the device info changes? (#966)

> The problem [use case](https://github.com/w3c/mediacapture-main/issues/966#issuecomment-1727807059) I gave was getUserMedia racing with the user putting on their headset.

In that use case, what we are after is a way for the web application to know what triggered the devicechange event.
Given the web app has an empty list returned by enumerateDevices prior the getUserMedia call, it cannot compute this information by calling enumerateDevices again. Maybe there is a change of default input, or a removal of an unused device, how can the web app know?

To help the web application, there are different approaches we could consider, for instance:
1. Fire a first devicechange event just after gerUserMedia resolution, to allow the web application grab the list of devices that were considered as part of the first getUserMedia call. Then fire a second devicechange event for the newly introduced device.
2. Provide more info directly on devicechange event, say a reason attribute containing a list of enums ('default-change', 'device-addition', 'device-removal').

-- 
GitHub Notification of comment by youennf
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/966#issuecomment-1734067067 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 25 September 2023 16:15:09 UTC