Re: [mediacapture-main] Only fire devicechange event when devices physically added/removed (#688)

Thanks for the raising issue.

I am not aware of any compat issue with Safari current behavior.

This is done as you described in Safari to limit compat risks with other browsers that were not doing the filtering. It seems the right time now that the spec mandates the filtering to get consistency here.

Some web applications may buffer enumerateDevices result and only update it based on the device change event. Firing the event after the first successful getUserMedia call ensures that web applications do not stick with a filtered list of devices.

As of detecting whether there is a new device or not, this is easy to determine.
In the new device detection algorithm, if the previous list of devices is empty or devices have empty device ids, there is no new device.

As of whether the spec can mandate to not fire an event, I am not sure it actually can.
Before the first successful getUserMedia call, there is no need for the user agent to retrieve and store the full list of devices when enumerateDevices is called.

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

Received on Friday, 24 April 2020 21:08:42 UTC