Skip to content

Commit

Permalink
Revert "fix(screenshare) Add and then mute the camera track after SS …
Browse files Browse the repository at this point in the history
…stops instead of not adding the track."

This workaround is not needed anymore since P2P is disabled between plan-b and unified-plan clients.
Fixes #11131

This reverts commit c300382.
  • Loading branch information
jallamsetty1 committed Mar 30, 2022
1 parent 4fe9f37 commit 9f5ffd3
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -1637,29 +1637,32 @@ export default {

APP.store.dispatch(setScreenAudioShareState(false));

promise = promise.then(() => createLocalTracksF({ devices: [ 'video' ] }))
.then(([ stream ]) => {
logger.debug(`_turnScreenSharingOff using ${stream} for useVideoStream`);
if (didHaveVideo && !ignoreDidHaveVideo) {
promise = promise.then(() => createLocalTracksF({ devices: [ 'video' ] }))
.then(([ stream ]) => {
logger.debug(`_turnScreenSharingOff using ${stream} for useVideoStream`);

return this.useVideoStream(stream);
})
.catch(error => {
logger.error('failed to switch back to local video', error);
return this.useVideoStream(stream);
})
.catch(error => {
logger.error('failed to switch back to local video', error);

return this.useVideoStream(null).then(() =>
return this.useVideoStream(null).then(() =>

// Still fail with the original err
Promise.reject(error)
);
// Still fail with the original err
Promise.reject(error)
);
});
} else {
promise = promise.then(() => {
logger.debug('_turnScreenSharingOff using null for useVideoStream');

return this.useVideoStream(null);
});
}

return promise.then(
() => {
// Mute the video if camera video needs to be ignored or if video was muted before switching to screen
// share.
if (ignoreDidHaveVideo || !didHaveVideo) {
APP.store.dispatch(setVideoMuted(true, MEDIA_TYPE.VIDEO));
}
this.videoSwitchInProgress = false;
sendAnalytics(createScreenSharingEvent('stopped',
duration === 0 ? null : duration));
Expand Down

0 comments on commit 9f5ffd3

Please sign in to comment.