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](https://chromestatus.com/metrics/feature/timeline/popularity/1119), dwarfing `getUserMedia` @ [0.6%](https://chromestatus.com/metrics/feature/timeline/popularity/1402). 💥

> 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](https://w3c.github.io/mediacapture-main/getusermedia.html#privacy-and-security-considerations): _"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](https://w3ctag.github.io/design-principles/#device-enumeration)."_

> 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 https://github.com/w3c/mediacapture-main/issues/874#issuecomment-1295482172 using your GitHub account


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

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