Closed Bug 1905841 Opened 2 years ago Closed 2 years ago

screen sharing events don't fire when windows close

Categories

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

Firefox 127
defect

Tracking

()

RESOLVED DUPLICATE of bug 1615282

People

(Reporter: bkafle25, Unassigned)

Details

Steps to reproduce:

When using the MediaStream API to capture a screen recording in Firefox, it's challenging to detect when the selected window for screen sharing is closed.
I have used the following code :
screenRecordingStream.value =
await navigator.mediaDevices.getDisplayMedia(
displayMediaOptions
);
screenRecordingStream.value.getTracks().forEach((track) => {
track.addEventListener('ended', () => {

});
track.addEventListener('inactive', () => {
 
    
 
});
track.addEventListener('inactive', () => {
    console.log('Track inactive');
    // ...
});
track.addEventListener('mute', () => {
    console.log('Track muted');
});
track.addEventListener('unmute', () => {
    console.log('Track unmuted');
});
track.addEventListener('overconstrained', () => {
    console.log('Track overconstrained');
});
track.addEventListener('readyStateChange', () => {
    console.log('Track ready state changed');
});

});

Actual results:

The MediaStreamTrack object provides several events, such as ended and inactive, but these events are not fired when the user closes the selected window.

Expected results:

It should have trigger some sort of an event to detect when the selected window for screen sharing has been closed.

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

Jib, can you comment on Firefox behavior related to windows being closed?

Flags: needinfo?(jib)
Summary: screen sharing doesnot stop even if the selected window is closed → screen sharing events don't fire when windows close
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1871423
Flags: needinfo?(jib)
Resolution: --- → DUPLICATE
Duplicate of bug: 1615282
No longer duplicate of bug: 1871423
You need to log in before you can comment on or make changes to this bug.