-
Notifications
You must be signed in to change notification settings - Fork 62
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
Only Firefox turns off device on disabled track. Stronger language needed? #642
Comments
Is the desired behavior from Hangouts' perspective "mute the track but don't turn the device off"? It would seem like this behavior is already supported with replaceTrack(null), and that using "enabled = false" for this effect is simply using the API incorrectly. Remind me, what is there a difference between sending a disabled track and sending a null track? If on the other hand we do turn off the device and the light, then re-prompting seems like the right thing to do. For privacy reasons we don't want a site to turn on the device without prompting. |
Hang on, if the desired effect is "turn off the device", why not use track.stop()? The way Chrome handles track.enabled kind of makes sense to me actually. |
The goal is to turn off the hardware light on mute. See blog. |
ending the track + using replaceTrack to send it again is cumbersome and error-prone so I strongly prefer Firefox' behaviour. |
Quoting my favorite blog ;)
OK I love it, this is good and motivates enabled as an API that deserves to exist separately from other "hacks". |
I see some value in 'enabled' as it stands but also see value in making it evolve. A web page can set enabled to false and set it back to true whenever it wants. We could try to emulate enabled=true as a sort of calling getUserMedia again with a mixture of enabled/muted/ended/user gesture restriction/focus mitigation. Not sure whether that is worth it. I also find the argument of the excessive reprompting a bit odd. |
If reprompting is or could be involved, async would be the way to go. What does Firefox do when you perform "track.enabled = true;"? |
I like this too. |
If that is the only use case
What is the significance of "hardware light"? The current language of the specification provides a means to clone, add, remove, replace tracks while not providing substantive content. Can the track can be changed to suit either expected output? The term "MAY" implies that implementers are free to do what they want. If implementers did not actually provide meaningful input to the specification themselves, either individually or on behalf of an entity, "MAY" allows for discretion. However, since in this case implementers appear to be involved with language in the primary document, "MAY" is ambiguous. Say "MUST". Leave no quarter for ambiguity. Some cases from the wild might be difficult, if possible at all, to specify at all to be congruous with all existing specifications or implementations, without updating all relevant language to be consistent. For example, |
Note, |
@youennf Thanks for catching that! I've filed bug 1598374 on Firefox. We plan to mitigate this by firing the muted event until page receives focus. Seems within the realm of what UAs are allowed.
Recall Firefox's prompt includes camera/mic selection; horribly misplaced on unmute, and semantically different unless the app remembers {video: {deviceId: {exact: track.getSettings().deviceId}}} Poorly written apps may forget chosen cam/mic on unmute, bc they didn't test w/multiple devices. Safari uses timed permissions. The spec works hard to not mandate a singular permission model. This accommodates UA differentiation in this still evolving space, which I think is good. Had we mandated one 7 years ago, it likely would have been Chrome's. I'm glad that didn't happen. One-off permission, like Firefox's, is expressly permitted and follows the spec closely. For instance, look how track stop ties into the Accessible privacy indicator (distinct from Live), e.g. gray vs red in Firefox. One-off permissions are not possible without a semantic difference between disabled and ended. The priority of constituencies suggests the spec's job is to define the best API abstraction for app writers and end-users, regardless of user agent. Do web authors find semantic value in using Will end-users be able to temporarily turn off/on their camera/mic in conference calls without a prompt in all browsers? Will indicators give them confidence they're not being watched? There is nothing preventing Safari from muting on |
Sure, as long as the caveat is clearly explained that
Remains to be seen.
Depends on whom is asked. There is no expectation of privacy for any signal communications. |
enabled is synchronous which makes it not straightforward to prompt on enabled value change.
Safari shows a browser UI to mute/unmute capture, this indicator is in sync with the hardware light and should give confidence for users. It is true that these indicators are not in sync with the page UI. This area is still evolving in browsers and its UI. |
(not following the details) It's a bug in Chrome. I think the spec language is fine. |
@youennf The user agent is allowed to fire the
|
@alvestrand Firefox does not require JS to do any reacquiring. Firefox does this in the background. So the semantics of the API are maintained. The only downside is a ~1 second delay on unmute before video shows. Try it in Firefox here. |
If we want to get stronger wording in the spec, we should probably define the behavior in terms of tracks muted state, at the page scope level. The scope level is important since page is the granularity of capture indicators for all browsers. Something like: if all 'live' tracks using a given device of a page are disabled, all of these tracks are marked as muted=true. Additionally, the spec should provide a model for when the web page might at some point want to restart capturing, i.e. unmute these tracks. |
Live camera/mic tracks can be turned on/off with the enabled attribute.
The obvious (and only?) use-case is the mute button:
Unfortunately, only Firefox turns off the device (and hardware light) in this case.
This has led to web compat issues:
Sites like Hangouts use a hack to get this desired property on Chrome: relinquish camera track on mute, and reacquire it w/
getUserMedia
on unmute (the microphone track is left alone, presumably because few mics have a light?)The hack backfires in Firefox, where Hangouts users get a needless extra prompt on unmute. Frustratingly, it would have worked beautifully in Firefox without the hack.
We worked hard to get this right in #389, but do we need stronger language to fix this web compat issue?
Right now we have: "when a track becomes either muted or disabled, and this brings all tracks connected to the device to be either muted, disabled, or stopped, then the UA MAY, using the device's deviceId, deviceId, set [[devicesLiveMap]][deviceId] to false"
Should this be a MUST? And do we need to say something about actually relinquishing the device?
If we can't get consensus on compatible behavior, should we scrap
enabled
?The text was updated successfully, but these errors were encountered: