Closed Bug 2007284 Opened 8 months ago Closed 8 months ago

Camera indicator light remains on after stopping getUserMedia video track when permission is granted before preview finishes (macOS, Firefox)

Categories

(Firefox :: Site Permissions, defect, P2)

Firefox 147
Unspecified
All
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox146 --- wontfix
firefox147 --- wontfix
firefox148 --- fixed

People

(Reporter: leon.wei, Assigned: emz, NeedInfo)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: regression)

Attachments

(3 files)

Attached file firefox-demo.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Steps to reproduce:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:147.0) Gecko/20100101 Firefox/147.0

  1. On macOS, open Firefox (tested on Firefox 145 / 146 / 147).
  2. Open a webpage that calls getUserMedia({ video: true }).
  3. Trigger getUserMedia() (e.g. by clicking a button).
  4. When the Firefox camera permission dialog appears:, Immediately click “Allow” before the permission dialog preview video finishes loading.
  5. stop all tracks: ( stream.getTracks().forEach(track => track.stop()); )

Actual results:

MediaStreamTrack.readyState becomes to "ended", but the macOS camera indicator light remains on indefinitely unless try capture audio stream or close Firefox .

I was unable to reproduce on window Firefox.

Expected results:

After calling MediaStreamTrack.stop() on all tracks, the macOS camera indicator light turns off.

The Bugbug bot thinks this bug should belong to the 'Core::WebRTC: Audio/Video' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core

add the preview screenshot img

The severity field is not set for this bug.
:jib, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jib)
OS: Unspecified → macOS
Hardware: Unspecified → ARM
Hardware: ARM → Unspecified
See Also: → 2005821

I saw this with a slightly different test file that set enabled to false on the content track immediately after the gUM stream promise resolved.
The CamerasChild::StartCapture() in the parent process capture was called after CamerasChild::StopCapture() in the content process.
https://pernos.co/debug/fqkQzdNz0HfRDs-AQgq-lg/index.html

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Regressed by: 799415

The code to prevent the preview was removed at https://hg-edge.mozilla.org/mozilla-central/rev/54a9e7679269#l1.21 and
https://hg-edge.mozilla.org/mozilla-central/rev/54a9e7679269#l1.151 and no replacement mechanism was provided.

The disconnectedCallback() won't stop the preview if it hasn't started yet.

Component: WebRTC: Audio/Video → Site Permissions
OS: macOS → All
Product: Core → Firefox

Set release status flags based on info from the regressing bug 799415

Severity: -- → S3
Priority: -- → P2
Assignee: nobody → emz
Status: NEW → ASSIGNED
Flags: needinfo?(jib)
Pushed by ezuehlcke@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/022c942d4079 https://hg.mozilla.org/integration/autoland/rev/68583bf964c8 Properly clean up webrtc previw video stream when preview is closed while loading. r=karlt
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch

The patch landed in nightly and beta is affected.
:emz, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(emz)
Flags: needinfo?(emz)
QA Whiteboard: [qa-triage-done-c149/b148][qa-ver-needed-c149/b148]
Flags: qe-verify+

Tried to reproduce the initial issue using Firefox 147 (Build ID: 20260105210555) and Nightly 148.0a1 (Build ID: 20260106212859) on macOS 15, but was unable to reproduce it. On my MacBook Pro, the camera indicator light turns off as expected on the affected Firefox versions.

@leon wei, could you please verify whether the issue is still reproducible on your end when using Firefox 148 Beta?

Flags: needinfo?(leon.wei)
QA Contact: sbadau
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: