Closed Bug 1857170 Opened 3 years ago Closed 3 years ago

Can't able to close camera

Categories

(Core :: WebRTC: Audio/Video, defect)

Firefox 118
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mozilkhan391, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0

Steps to reproduce:

Run following code only it's cannot close the camera firefox

const closeCamera = () => {
try {
if (stream) {
const tracks = stream.getTracks();
tracks.forEach((track) => track.stop());
}
setPermission(false);
clearRecordingTime();
} catch (error) {
console.error('Error closing camera:', error);
}
};

Actual results:

Camera is still using by Firefox.

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

You can see this work on a basic test page like https://mozilla.github.io/webrtc-landing/gum_test.html -- click "Camera" and approve the prompt, then click "Stop".

Next time, please attach a reduced reproducible test case so there is something to debug.
The code you included contain some proprietary functions whose definitions you didn't include, so I cannot run it. The console would tell you this through the logged error though.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: