Open Bug 1596959 Opened 5 years ago Updated 2 years ago

The checkbox on the camera and microphone device access prompts provide an awkward experience in some scenarios.


(Core :: WebRTC: Audio/Video, enhancement, P5)





(Reporter: eighteighteightyeight, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Steps to reproduce:

My team maintains a website that makes multiple calls to navigator.mediaDevices.getUserMedia() during the process of a user's session.

We are providing customers with a telemedicine website. One the site we play audio prompts and record their responses by accessing their microphone. We also take multiple pictures as part of the experience. We looked at keeping a reference to the microphone streams, but the microphone streams work best when they are closed out prior to playing audio prompts.

Actual results:

When the call is made the first time the user is prompted to allow device access. There is a checkbox on the prompt to remember the decision. If the user does not check the box they will be prompted again on subsequent calls.

Expected results:

I would like to have the browser remember the users decision throughout the duration of the session.

It would help if you indicated within what timeframe you'd reuse the user's single grant. The problem with session duration is that a session might last days.

Component: Untriaged → WebRTC
Product: Firefox → Core

That is a good point. 15 minutes should be plenty of time for our situation.

:jib, could you please help triage this one? I'm not sure if this is something we'd want to do or not.

Ever confirmed: true
Flags: needinfo?(jib)

Firefox's privacy guarantee is that once camera/mic indicators go away, they cannot come back unless users checked the box.

We looked at keeping a reference to the microphone streams, but the microphone streams work best when they are closed out prior to playing audio prompts.

You should be able to work around this using the following:

window.keepalive = stream.clone();
for (const track of window.keepalive.getTracks()) track.enabled = false;

Everything should behave as before, except you'll see gray (not red) camera/mic indicators in the URL bar when everything is off, and they'll turn red again instead of you being re-prompted when you request access anew.

See for more details.

Unfortunately, other browsers haven't followed suit, with sites like Hangouts still doing hacks (relinquishing the stream) when you click on the camera mute button (presumably to get the hardware light to go off on mute in Chrome - crbug 642785), which causes annoying re-prompts in Firefox on unmute. Ironically, had they merely set track.enabled = !muted.checked as the spec intended, Hangouts would have worked as expected in Firefox.

I've opened w3c/mediacapture-main#642 to push the other browsers on this.

Happy to leave this open for discussion, but unless the permissions team wishes to pick this up, I don't think the media team has any plans for changes here.

Flags: needinfo?(jib)
Priority: -- → P5
Component: WebRTC → WebRTC: Audio/Video
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.