fix(conference): do not go back to video

Do not go back to video from screen sharing if there was no video stream
at the time when screen sharing was being started.
This commit is contained in:
paweldomas 2017-06-16 09:24:59 -05:00 committed by virtuacoplenny
parent d84ab20a47
commit a7025c41f6
1 changed files with 13 additions and 11 deletions

View File

@ -1140,6 +1140,8 @@ export default {
let externalInstallation = false;
if (shareScreen) {
const didHaveVideo = Boolean(this.localVideo);
return createLocalTracks({
desktopSharingSources: options.desktopSharingSources,
devices: ['desktop'],
@ -1170,18 +1172,18 @@ export default {
// close external installation dialog on success.
if(externalInstallation)
$.prompt.close();
stream.on(
TrackEvents.LOCAL_TRACK_STOPPED,
() => {
// if stream was stopped during screensharing session
// then we should switch to video
// otherwise we stopped it because we already switched
// to video, so nothing to do here
if (this.isSharingScreen) {
this.toggleScreenSharing(false);
if (didHaveVideo) {
stream.on(
TrackEvents.LOCAL_TRACK_STOPPED,
() => {
// If the stream was stopped during screen sharing
// session then we should switch back to video.
if (this.isSharingScreen) {
this.toggleScreenSharing(false);
}
}
}
);
);
}
return this.useVideoStream(stream);
}).then(() => {
this.videoSwitchInProgress = false;