|
@@ -1334,19 +1334,35 @@ export default {
|
1334
|
1334
|
replaceLocalTrack(this.localVideo, newStream, room))
|
1335
|
1335
|
.then(() => {
|
1336
|
1336
|
this.localVideo = newStream;
|
1337
|
|
-
|
|
1337
|
+ this._setSharingScreen(newStream);
|
1338
|
1338
|
if (newStream) {
|
1339
|
|
- this.isSharingScreen = newStream.videoType === 'desktop';
|
1340
|
|
-
|
1341
|
1339
|
APP.UI.addLocalStream(newStream);
|
1342
|
|
- } else {
|
1343
|
|
- this.isSharingScreen = false;
|
1344
|
1340
|
}
|
1345
|
1341
|
this.setVideoMuteStatus(this.isLocalVideoMuted());
|
1346
|
|
- APP.UI.updateDesktopSharingButtons();
|
1347
|
1342
|
});
|
1348
|
1343
|
},
|
1349
|
1344
|
|
|
1345
|
+ /**
|
|
1346
|
+ * Sets `this.isSharingScreen` depending on provided video stream.
|
|
1347
|
+ * In case new screen sharing status is not equal previous one
|
|
1348
|
+ * it updates desktop sharing buttons in UI
|
|
1349
|
+ * and notifies external application.
|
|
1350
|
+ *
|
|
1351
|
+ * @param {JitsiLocalTrack} [newStream] new stream to use or null
|
|
1352
|
+ * @private
|
|
1353
|
+ * @returns {void}
|
|
1354
|
+ */
|
|
1355
|
+ _setSharingScreen(newStream) {
|
|
1356
|
+ const wasSharingScreen = this.isSharingScreen;
|
|
1357
|
+
|
|
1358
|
+ this.isSharingScreen = newStream && newStream.videoType === 'desktop';
|
|
1359
|
+
|
|
1360
|
+ if (wasSharingScreen !== this.isSharingScreen) {
|
|
1361
|
+ APP.UI.updateDesktopSharingButtons();
|
|
1362
|
+ APP.API.notifyScreenSharingStatusChanged(this.isSharingScreen);
|
|
1363
|
+ }
|
|
1364
|
+ },
|
|
1365
|
+
|
1350
|
1366
|
/**
|
1351
|
1367
|
* Start using provided audio stream.
|
1352
|
1368
|
* Stops previous audio stream.
|