|
@@ -1140,6 +1140,8 @@ export default {
|
1140
|
1140
|
let externalInstallation = false;
|
1141
|
1141
|
|
1142
|
1142
|
if (shareScreen) {
|
|
1143
|
+ const didHaveVideo = Boolean(this.localVideo);
|
|
1144
|
+
|
1143
|
1145
|
return createLocalTracks({
|
1144
|
1146
|
desktopSharingSources: options.desktopSharingSources,
|
1145
|
1147
|
devices: ['desktop'],
|
|
@@ -1170,18 +1172,18 @@ export default {
|
1170
|
1172
|
// close external installation dialog on success.
|
1171
|
1173
|
if(externalInstallation)
|
1172
|
1174
|
$.prompt.close();
|
1173
|
|
- stream.on(
|
1174
|
|
- TrackEvents.LOCAL_TRACK_STOPPED,
|
1175
|
|
- () => {
|
1176
|
|
- // if stream was stopped during screensharing session
|
1177
|
|
- // then we should switch to video
|
1178
|
|
- // otherwise we stopped it because we already switched
|
1179
|
|
- // to video, so nothing to do here
|
1180
|
|
- if (this.isSharingScreen) {
|
1181
|
|
- this.toggleScreenSharing(false);
|
|
1175
|
+ if (didHaveVideo) {
|
|
1176
|
+ stream.on(
|
|
1177
|
+ TrackEvents.LOCAL_TRACK_STOPPED,
|
|
1178
|
+ () => {
|
|
1179
|
+ // If the stream was stopped during screen sharing
|
|
1180
|
+ // session then we should switch back to video.
|
|
1181
|
+ if (this.isSharingScreen) {
|
|
1182
|
+ this.toggleScreenSharing(false);
|
|
1183
|
+ }
|
1182
|
1184
|
}
|
1183
|
|
- }
|
1184
|
|
- );
|
|
1185
|
+ );
|
|
1186
|
+ }
|
1185
|
1187
|
return this.useVideoStream(stream);
|
1186
|
1188
|
}).then(() => {
|
1187
|
1189
|
this.videoSwitchInProgress = false;
|