Re: [mediacapture-main] enumerateDevices() should request permission (#874)

> enumerateDevices() should request permission ... basically useless until permission is granted. 

Note enumerateDevices is called by trackers in [8% of pages](, dwarfing `getUserMedia` @ [0.6%]( 💥

> What would be more desirable: 
> ... 2. User is prompted to approve access to cameras and/or microphones, and hopefully approves.

Why should users have to grant permission to all cameras to use one? That's an undesirable permission escalation from Mozilla's perspective, and the [TAG agrees]( _"This specification exposes device information of devices other than those in use. This is for backwards compatibility and legacy reasons. Future specifications are advised to not use this model and instead follow best practices as described in the[ device enumeration design principles]("_

> an alternative is to add some other way to request permission as an independent step to capturing or enumerating.

This has the same permission escalation problem.

Another alternative is to look at what Firefox implements:
1.   Application awaits getUserMedia()
2.  User is prompted to approve access to _one_ camera and/or _one_ microphone from a list in the prompt
3.  User chooses what they want
4.  Application gets a stream, without requiring additional approval from the user
5.  Application remembers track.getSettings()deviceId for next time

This seems to solve your problem without violating W3C design principles, so this doesn't seem to be a spec problem.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Friday, 28 October 2022 21:25:56 UTC