Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(audio-only-ss): Attach a track stopped handler to the audioDesktop track only for audio-only sharing case. There will be an audio desktop track for regular screensahring when a tab is selected. We do not have to toggle screensharing again when that track is killed.

Jaya Allamsettyca095240b9e5
diff --git a/react/features/base/conference/middleware.web.js b/react/features/base/conference/middleware.web.js
index 27f1b5ed7b..b08d791f29 100644
--- a/react/features/base/conference/middleware.web.js
+++ b/react/features/base/conference/middleware.web.js
@@ -231,12 +231,12 @@ async function _toggleScreenSharing({ enabled, audioOnly = false, shareOptions =
_maybeApplyAudioMixerEffect(desktopAudioTrack, state);
dispatch(setScreenshareAudioTrack(desktopAudioTrack));
- // Handle the case where screen share was stopped from the browsers 'screen share in progress' window.
- desktopAudioTrack.on(
- JitsiTrackEvents.LOCAL_TRACK_STOPPED,
- () => {
- dispatch(toggleScreensharing(undefined, true));
- });
+ // Handle the case where screen share was stopped from the browsers 'screen share in progress' window.
+ if (audioOnly) {
+ desktopAudioTrack?.on(
+ JitsiTrackEvents.LOCAL_TRACK_STOPPED,
+ () => dispatch(toggleScreensharing(undefined, true)));
+ }
}
// Disable audio-only or best performance mode if the user starts screensharing. This doesn't apply to