w3c / mediacapture-extensions

Extensions to Media Capture and Streams by the WebRTC Working Group
https://w3c.github.io/mediacapture-extensions/
Other
19 stars 15 forks source link

Broader API proposals for device selection and permissions #8

Open hills opened 4 years ago

hills commented 4 years ago

As supplement to a previous ticket I posted a broader API suggestions, and it was suggested these would be a good 'issue' in their own right for discussion.

I've tried to wholistically address a number of issues around permissions, fingerprinting and device selection.

I'm afraid I'm very much just a user of these APIs on a practical level, with a day job, so that doesn't leave me a lot of time to comb the specifications or be intricately in tune with details of every discussion. Though I have been reading here to try and get up to speed with the issues to do my best to ensure this is relevant.

I do hope you will see this from a distance; reining back complexity and special cases, not adding more, and within the constraints of the existing API. I hope you don't mind considering broader goals from an outside contributor.


Calls to getUserMedia that do not specify a device ID (or specify "default") would be governed by a "permission to use your camera/microphone" dialogue provided by the browser:

And then, independently a permissions flag (looks like [[canExposeDeviceInfo]]?):

And that's it!

What my goals are in the above proposal:

One thing the above embodies, which seems to be fighting in the other issues (such as w3c/mediacapture-extensions#6) is whether deviceID is a first class consideration. Whilst its clever to try and channel deviceID as just another constraint, the separation of 'what' media the client has access to, versus 'how' it samples that media, could be inevitible.

It is good to remember that not all apps are standard video conferencing apps, and already WebAudio apps for producivity use multiple devices concurrently.

youennf commented 4 years ago
  • enumerateDevices() needing to happen after getUserMedia()

You can call enumerateDevices before getUserMedia. It will tell you whether there are microphones and/or cameras, which should give you enough to craft your UI and getUserMedia request.

  • 'fake' data now, complete data later should be considered evil

This is not fake data, this is limited data and complete data if user agrees.

  • Tackle fingerprinting issues; no deviceIDs are ever seen by a page without user permission

The current design enforces this.

  • Prevent 99% of developers having to build device selection UIs unnecessarily:

There is a proposal for a device picker that hopefully can address that.

whilst its clever to try and channel deviceID as just another constraint, the separation of 'what' media the client has access to, versus 'how' it samples that media, could be inevitible.

I agree. getUserMedia model is made more complex than it should because we try to mix selection and setup in one step. Selection should be the primary focus of getUserMedia, setup can be mostly delegated to applyConstraints.

To make progress here, it would be nice to understand the exact cases you find difficult or impossible to implement with the current API design. This would make it much easier to try updating the current design.

guest271314 commented 4 years ago

There is a proposal for a device picker that hopefully can address that.

Can you kindly link to that proposal?

Selection should be the primary focus of getUserMedia

That is currently impossible using initial call to getUserMedia() alone at Chromium due to

Chromium presently omits device selection on getUserMedia

Screenshot_2020-09-05_09-36-36