feat(presenter): Modify the default behavior for presenter mode, it set to off when screensharing is turned on. Also, revert video to the original state when screensharing is turned off.

This commit is contained in:
Jaya Allamsetty 2019-11-27 12:36:44 -05:00 committed by virtuacoplenny
parent 58bd48c1ae
commit bcc1289a23
1 changed files with 3 additions and 33 deletions

View File

@ -825,8 +825,6 @@ export default {
await this.localVideo.setEffect(undefined);
APP.store.dispatch(
setVideoMuted(mute, MEDIA_TYPE.PRESENTER));
this._untoggleScreenSharing
= this._turnScreenSharingOff.bind(this, false);
} catch (err) {
logger.error('Failed to mute the Presenter video');
}
@ -850,8 +848,6 @@ export default {
try {
await this.localVideo.setEffect(effect);
APP.store.dispatch(setVideoMuted(mute, MEDIA_TYPE.PRESENTER));
this._untoggleScreenSharing
= this._turnScreenSharingOff.bind(this, true);
} catch (err) {
logger.error('Failed to apply the Presenter effect', err);
}
@ -1496,39 +1492,13 @@ export default {
}
if (toggle) {
const wasVideoMuted = this.isLocalVideoMuted();
try {
await this._switchToScreenSharing(options);
return;
} catch (err) {
logger.error('Failed to switch to screensharing', err);
return;
}
if (wasVideoMuted) {
return;
}
const { height } = this.localVideo.track.getSettings();
const defaultCamera
= getUserSelectedCameraDeviceId(APP.store.getState());
let effect;
try {
effect = await this._createPresenterStreamEffect(
height, defaultCamera);
} catch (err) {
logger.error('Failed to create the presenter effect');
return;
}
try {
await this.localVideo.setEffect(effect);
muteLocalVideo(false);
return;
} catch (err) {
logger.error('Failed to create the presenter effect', err);
return;
}
}
@ -1555,7 +1525,7 @@ export default {
_createDesktopTrack(options = {}) {
let externalInstallation = false;
let DSExternalInstallationInProgress = false;
const didHaveVideo = Boolean(this.localVideo);
const didHaveVideo = !this.isLocalVideoMuted();
const getDesktopStreamPromise = options.desktopStream
? Promise.resolve([ options.desktopStream ])