-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the granularity of a source? #940
Comments
If we define an API to mute tracks, we will probably define as muting the source. |
I see benefit in discussing granularity of a source irrespective of mute. Muted is a UA-controlled property of the track, not the source.¹ Keeping it that way may be important to solve w3c/mediacapture-extensions#39, where one application with transient activation calling There are privacy issues in the User Agent space here, which we've traditionally handled in the "Best Practice" section. I think UAs are handling muting well (but differently) today, so I see no reason to further restrict them here. 1. The spec's mention of "state of the source" seems to exist solely to ensure consistency between clones created by getUserMedia instead of track.clone(). |
This would mean that const track1 = navigator.mediaDevices.getUserMedia({video: {deviceId: {exact: deviceId}});
const track2 = navigator.mediaDevices.getUserMedia({video: {deviceId: {exact: deviceId}});
const track3 = track1.clone(); What benefit would this distinction have? I don't think it exists in Firefox and Chrome. Does it exist in Safari? This interpretation is NOT supported by spec IMHO, because The minimum granularity has to be at least the JS realm for the spec to work, i.e. the
Uses of multiple cameras seem different from multiple uses of the same camera. I don't see the connection. |
It used to be like this in Safari. It could happen in the future.
Say you do the following:
Everything works fine. Now you start another capture:
In that case, you might still be able to capture the environment at 640 but not at 1280.
Right, I guess we could change this if there was a use case for it but it does not seem worth it. Can we settle on source granularity being the JS realm then? |
When you say "fail" here, you mean WebKit would end active tracks because another call to getUserMedia was made? Even so, track ended doesn't rely on source stopped. It's the other way around. Firefox would instead fail creation of const track1 = navigator.mediaDevices.getUserMedia({video: {facingMode: 'environment', width:640});
const track2 = track1.clone(); await track2.applyConstraints({video: {width:1280}});
const track3 = navigator.mediaDevices.getUserMedia({video: {facingMode: 'user', width:640}); This seems like POLA, an invariant worth clarifying in the spec, so implementations don't implement side effects that could affect API usage.
True, but this seems trivially avoided by using a
Can we eliminate option 1 first? I'd like to discuss the remaining options, but wanted to simplify first. |
While a source being UA-wide may have worked in the past, it breaks #804 so I think we're down to:
As the stop all sources algorithm is currently written, it only works with 1. So the archeological answer is 1. But I'd like to propose 2. If we look at what source/device intersects with in the spec, it's: permission, privacy indicators, and track lifetime. Permissions integration ties device permission to the top-level document, and privacy indicators are implemented at that level too. Regarding lifetime, I think our main concern in w3c/mediacapture-extensions#30 was also around privacy and permission. E.g. that a user revoking permission in the original web page ends transferred tracks as well, and that privacy indicators remain on the original web page's tab for as long as transferred tracks are alive. In the old days, we didn't have to consider track lifetime outside of the document that spawned a track, but now we do. And it seems to me that tying lifetime to the top-level document might be fine. |
It might make the spec easier to understand if we could get consensus on what the granularity of a source is.
We know that:
The spec in some places may assume 2 or 3.
The most flexible option is probably option 1, this was used like this in the past in some Safari cases (where multiple cameras cannot run at the same time for instance).
The text was updated successfully, but these errors were encountered: