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

> Once all browsers implement the spec correctly, it should be normal to expect:
> 
> 1. Near-zero information from enumerateDevices() ahead of gUM() (basically: mic absence and/or cam absence)
> 2. Full access to device information of the granted kind(s) post gUM()
> 
> I see no value in ever firing `devicechange` from 1 to 2, even if we expand sensitivity to changes in information in 2.
> 
If an application is interested in tracking changes to the result to enumerateDevices(), it can just call enumerateDevices() in a loop to detect them.  Firing devicechange is a better way to avoid this inefficient way of doing it. 

> > Applications may be interested in more general device availability, which covers other changes to the result of enumerateDevices.
> 
> What sort of changes? The text mentions changes to the _"the system default"_, which can be a signal that a user may wish to (auto) switch, so belongs on the list IMHO. Anything else?

The result of enumerateDevices() might change (depending on UA choice of implementation) due to:
* UA-level Permission revocation.
* OS-level permission revocation.
* OS-level disabling of a device without unplugging it (e.g., user closing the laptop lid and the OS suspending the camera as an active device, or the user disabling the device via an OS setting).
*  User clearing browsing data, which causes device IDs to change.

All these changes are detectable by polling enumerateDevices(), and should be available via devicechange to avoid having applications inefficiently enumerating devices in a loop.

None of this implies firing devicechange every time gUM is called, which I see as an orthogonal issue. An application can call gUM multiple times while the result of enumerateDevices is visible. If the result of enumerateDevices() doesn't change as a consequence of those calls I see no reason to fire devicechange.



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


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

Received on Wednesday, 20 September 2023 21:49:45 UTC