|
@@ -38,8 +38,12 @@ import {
|
38
|
38
|
isFatalJitsiConnectionError
|
39
|
39
|
} from './react/features/base/lib-jitsi-meet';
|
40
|
40
|
import {
|
|
41
|
+ isVideoMutedByUser,
|
|
42
|
+ MEDIA_TYPE,
|
41
|
43
|
setAudioAvailable,
|
42
|
|
- setVideoAvailable
|
|
44
|
+ setAudioMuted,
|
|
45
|
+ setVideoAvailable,
|
|
46
|
+ setVideoMuted
|
43
|
47
|
} from './react/features/base/media';
|
44
|
48
|
import {
|
45
|
49
|
localParticipantConnectionStatusChanged,
|
|
@@ -54,6 +58,7 @@ import {
|
54
|
58
|
} from './react/features/base/participants';
|
55
|
59
|
import {
|
56
|
60
|
createLocalTracks,
|
|
61
|
+ isLocalTrackMuted,
|
57
|
62
|
replaceLocalTrack,
|
58
|
63
|
trackAdded,
|
59
|
64
|
trackRemoved
|
|
@@ -87,7 +92,6 @@ const eventEmitter = new EventEmitter();
|
87
|
92
|
|
88
|
93
|
let room;
|
89
|
94
|
let connection;
|
90
|
|
-let localAudio, localVideo;
|
91
|
95
|
|
92
|
96
|
/*
|
93
|
97
|
* Logic to open a desktop picker put on the window global for
|
|
@@ -134,7 +138,7 @@ function connect(roomName) {
|
134
|
138
|
* @param {string} value new value
|
135
|
139
|
*/
|
136
|
140
|
function sendData(command, value) {
|
137
|
|
- if(!room) {
|
|
141
|
+ if (!room) {
|
138
|
142
|
return;
|
139
|
143
|
}
|
140
|
144
|
|
|
@@ -184,47 +188,18 @@ function getDisplayName(id) {
|
184
|
188
|
/**
|
185
|
189
|
* Mute or unmute local audio stream if it exists.
|
186
|
190
|
* @param {boolean} muted - if audio stream should be muted or unmuted.
|
187
|
|
- *
|
188
|
|
- * @returns {Promise} resolved in case mute/unmute operations succeeds or
|
189
|
|
- * rejected with an error if something goes wrong. It is expected that often
|
190
|
|
- * the error will be of the {@link JitsiTrackError} type, but it's not
|
191
|
|
- * guaranteed.
|
192
|
191
|
*/
|
193
|
192
|
function muteLocalAudio(muted) {
|
194
|
|
- return muteLocalMedia(localAudio, muted);
|
195
|
|
-}
|
196
|
|
-
|
197
|
|
-/**
|
198
|
|
- * Mute or unmute local media stream if it exists.
|
199
|
|
- * @param {JitsiLocalTrack} localTrack
|
200
|
|
- * @param {boolean} muted
|
201
|
|
- *
|
202
|
|
- * @returns {Promise} resolved in case mute/unmute operations succeeds or
|
203
|
|
- * rejected with an error if something goes wrong. It is expected that often
|
204
|
|
- * the error will be of the {@link JitsiTrackError} type, but it's not
|
205
|
|
- * guaranteed.
|
206
|
|
- */
|
207
|
|
-function muteLocalMedia(localTrack, muted) {
|
208
|
|
- if (!localTrack) {
|
209
|
|
- return Promise.resolve();
|
210
|
|
- }
|
211
|
|
-
|
212
|
|
- const method = muted ? 'mute' : 'unmute';
|
213
|
|
-
|
214
|
|
- return localTrack[method]();
|
|
193
|
+ APP.store.dispatch(setAudioMuted(muted));
|
215
|
194
|
}
|
216
|
195
|
|
217
|
196
|
/**
|
218
|
197
|
* Mute or unmute local video stream if it exists.
|
219
|
198
|
* @param {boolean} muted if video stream should be muted or unmuted.
|
220
|
199
|
*
|
221
|
|
- * @returns {Promise} resolved in case mute/unmute operations succeeds or
|
222
|
|
- * rejected with an error if something goes wrong. It is expected that often
|
223
|
|
- * the error will be of the {@link JitsiTrackError} type, but it's not
|
224
|
|
- * guaranteed.
|
225
|
200
|
*/
|
226
|
201
|
function muteLocalVideo(muted) {
|
227
|
|
- return muteLocalMedia(localVideo, muted);
|
|
202
|
+ APP.store.dispatch(setVideoMuted(muted));
|
228
|
203
|
}
|
229
|
204
|
|
230
|
205
|
/**
|
|
@@ -458,8 +433,6 @@ export default {
|
458
|
433
|
*/
|
459
|
434
|
_localTracksInitialized: false,
|
460
|
435
|
isModerator: false,
|
461
|
|
- audioMuted: false,
|
462
|
|
- videoMuted: false,
|
463
|
436
|
isSharingScreen: false,
|
464
|
437
|
/**
|
465
|
438
|
* Indicates if the desktop sharing functionality has been enabled.
|
|
@@ -491,6 +464,21 @@ export default {
|
491
|
464
|
*/
|
492
|
465
|
isDominantSpeaker: false,
|
493
|
466
|
|
|
467
|
+ /**
|
|
468
|
+ * The local audio track (if any).
|
|
469
|
+ * FIXME tracks from redux store should be the single source of truth
|
|
470
|
+ * @type {JitsiLocalTrack|null}
|
|
471
|
+ */
|
|
472
|
+ localAudio: null,
|
|
473
|
+
|
|
474
|
+ /**
|
|
475
|
+ * The local video track (if any).
|
|
476
|
+ * FIXME tracks from redux store should be the single source of truth, but
|
|
477
|
+ * more refactoring is required around screen sharing ('localVideo' usages).
|
|
478
|
+ * @type {JitsiLocalTrack|null}
|
|
479
|
+ */
|
|
480
|
+ localVideo: null,
|
|
481
|
+
|
494
|
482
|
/**
|
495
|
483
|
* Creates local media tracks and connects to a room. Will show error
|
496
|
484
|
* dialogs in case accessing the local microphone and/or camera failed. Will
|
|
@@ -655,13 +643,13 @@ export default {
|
655
|
643
|
init(options) {
|
656
|
644
|
this.roomName = options.roomName;
|
657
|
645
|
// attaches global error handler, if there is already one, respect it
|
658
|
|
- if(JitsiMeetJS.getGlobalOnErrorHandler){
|
|
646
|
+ if (JitsiMeetJS.getGlobalOnErrorHandler){
|
659
|
647
|
var oldOnErrorHandler = window.onerror;
|
660
|
648
|
window.onerror = function (message, source, lineno, colno, error) {
|
661
|
649
|
JitsiMeetJS.getGlobalOnErrorHandler(
|
662
|
650
|
message, source, lineno, colno, error);
|
663
|
651
|
|
664
|
|
- if(oldOnErrorHandler)
|
|
652
|
+ if (oldOnErrorHandler)
|
665
|
653
|
oldOnErrorHandler(message, source, lineno, colno, error);
|
666
|
654
|
};
|
667
|
655
|
|
|
@@ -671,7 +659,7 @@ export default {
|
671
|
659
|
JitsiMeetJS.getGlobalOnErrorHandler(
|
672
|
660
|
null, null, null, null, event.reason);
|
673
|
661
|
|
674
|
|
- if(oldOnUnhandledRejection)
|
|
662
|
+ if (oldOnUnhandledRejection)
|
675
|
663
|
oldOnUnhandledRejection(event);
|
676
|
664
|
};
|
677
|
665
|
}
|
|
@@ -690,9 +678,10 @@ export default {
|
690
|
678
|
});
|
691
|
679
|
}).then(([tracks, con]) => {
|
692
|
680
|
tracks.forEach(track => {
|
693
|
|
- if (track.isAudioTrack() && this.audioMuted) {
|
|
681
|
+ if (track.isAudioTrack() && this.isLocalAudioMuted()) {
|
694
|
682
|
track.mute();
|
695
|
|
- } else if (track.isVideoTrack() && this.videoMuted) {
|
|
683
|
+ } else if (track.isVideoTrack()
|
|
684
|
+ && this.isLocalVideoMuted()) {
|
696
|
685
|
track.mute();
|
697
|
686
|
}
|
698
|
687
|
});
|
|
@@ -731,12 +720,10 @@ export default {
|
731
|
720
|
// to the conference
|
732
|
721
|
if (!tracks.find((t) => t.isAudioTrack())) {
|
733
|
722
|
this.setAudioMuteStatus(true);
|
734
|
|
- APP.UI.setAudioMuted(this.getMyUserId(), this.audioMuted);
|
735
|
723
|
}
|
736
|
724
|
|
737
|
725
|
if (!tracks.find((t) => t.isVideoTrack())) {
|
738
|
726
|
this.setVideoMuteStatus(true);
|
739
|
|
- APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
|
740
|
727
|
}
|
741
|
728
|
|
742
|
729
|
this._initDeviceList();
|
|
@@ -759,6 +746,20 @@ export default {
|
759
|
746
|
isLocalId(id) {
|
760
|
747
|
return this.getMyUserId() === id;
|
761
|
748
|
},
|
|
749
|
+
|
|
750
|
+ /**
|
|
751
|
+ * Tells whether the local video is muted or not.
|
|
752
|
+ * @return {boolean}
|
|
753
|
+ */
|
|
754
|
+ isLocalVideoMuted() {
|
|
755
|
+ // If the tracks are not ready, read from base/media state
|
|
756
|
+ return this._localTracksInitialized
|
|
757
|
+ ? isLocalTrackMuted(
|
|
758
|
+ APP.store.getState()['features/base/tracks'],
|
|
759
|
+ MEDIA_TYPE.VIDEO)
|
|
760
|
+ : isVideoMutedByUser(APP.store);
|
|
761
|
+ },
|
|
762
|
+
|
762
|
763
|
/**
|
763
|
764
|
* Simulates toolbar button click for audio mute. Used by shortcuts and API.
|
764
|
765
|
* @param {boolean} mute true for mute and false for unmute.
|
|
@@ -768,38 +769,31 @@ export default {
|
768
|
769
|
muteAudio(mute, showUI = true) {
|
769
|
770
|
// Not ready to modify track's state yet
|
770
|
771
|
if (!this._localTracksInitialized) {
|
|
772
|
+ // This will only modify base/media.audio.muted which is then synced
|
|
773
|
+ // up with the track at the end of local tracks initialization.
|
|
774
|
+ muteLocalAudio(mute);
|
771
|
775
|
this.setAudioMuteStatus(mute);
|
|
776
|
+
|
772
|
777
|
return;
|
773
|
|
- } else if (localAudio && localAudio.isMuted() === mute) {
|
|
778
|
+ } else if (this.isLocalAudioMuted() === mute) {
|
774
|
779
|
// NO-OP
|
775
|
780
|
return;
|
776
|
781
|
}
|
777
|
782
|
|
778
|
|
- const maybeShowErrorDialog = (error) => {
|
779
|
|
- if (showUI) {
|
780
|
|
- APP.UI.showMicErrorNotification(error);
|
781
|
|
- }
|
782
|
|
- };
|
783
|
|
-
|
784
|
|
- if (!localAudio && this.audioMuted && !mute) {
|
|
783
|
+ if (!this.localAudio && !mute) {
|
785
|
784
|
createLocalTracks({ devices: ['audio'] }, false)
|
786
|
785
|
.then(([audioTrack]) => audioTrack)
|
787
|
786
|
.catch(error => {
|
788
|
|
- maybeShowErrorDialog(error);
|
|
787
|
+ if (showUI) {
|
|
788
|
+ APP.UI.showMicErrorNotification(error);
|
|
789
|
+ }
|
789
|
790
|
|
790
|
791
|
// Rollback the audio muted status by using null track
|
791
|
792
|
return null;
|
792
|
793
|
})
|
793
|
794
|
.then(audioTrack => this.useAudioStream(audioTrack));
|
794
|
795
|
} else {
|
795
|
|
- const oldMutedStatus = this.audioMuted;
|
796
|
|
-
|
797
|
|
- muteLocalAudio(mute)
|
798
|
|
- .catch(error => {
|
799
|
|
- maybeShowErrorDialog(error);
|
800
|
|
- this.setAudioMuteStatus(oldMutedStatus);
|
801
|
|
- APP.UI.setAudioMuted(this.getMyUserId(), this.audioMuted);
|
802
|
|
- });
|
|
796
|
+ muteLocalAudio(mute);
|
803
|
797
|
}
|
804
|
798
|
},
|
805
|
799
|
/**
|
|
@@ -807,7 +801,13 @@ export default {
|
807
|
801
|
* @returns {boolean}
|
808
|
802
|
*/
|
809
|
803
|
isLocalAudioMuted() {
|
810
|
|
- return this.audioMuted;
|
|
804
|
+ // If the tracks are not ready, read from base/media state
|
|
805
|
+ return this._localTracksInitialized
|
|
806
|
+ ? isLocalTrackMuted(
|
|
807
|
+ APP.store.getState()['features/base/tracks'],
|
|
808
|
+ MEDIA_TYPE.AUDIO)
|
|
809
|
+ : Boolean(
|
|
810
|
+ APP.store.getState()['features/base/media'].audio.muted);
|
811
|
811
|
},
|
812
|
812
|
/**
|
813
|
813
|
* Simulates toolbar button click for audio mute. Used by shortcuts
|
|
@@ -816,7 +816,7 @@ export default {
|
816
|
816
|
* dialogs in case of media permissions error.
|
817
|
817
|
*/
|
818
|
818
|
toggleAudioMuted(showUI = true) {
|
819
|
|
- this.muteAudio(!this.audioMuted, showUI);
|
|
819
|
+ this.muteAudio(!this.isLocalAudioMuted(), showUI);
|
820
|
820
|
},
|
821
|
821
|
/**
|
822
|
822
|
* Simulates toolbar button click for video mute. Used by shortcuts and API.
|
|
@@ -825,12 +825,15 @@ export default {
|
825
|
825
|
* dialogs in case of media permissions error.
|
826
|
826
|
*/
|
827
|
827
|
muteVideo(mute, showUI = true) {
|
828
|
|
- // Not ready to modify track's state yet
|
|
828
|
+ // If not ready to modify track's state yet adjust the base/media
|
829
|
829
|
if (!this._localTracksInitialized) {
|
|
830
|
+ // This will only modify base/media.video.muted which is then synced
|
|
831
|
+ // up with the track at the end of local tracks initialization.
|
|
832
|
+ muteLocalVideo(mute);
|
830
|
833
|
this.setVideoMuteStatus(mute);
|
831
|
834
|
|
832
|
835
|
return;
|
833
|
|
- } else if (localVideo && localVideo.isMuted() === mute) {
|
|
836
|
+ } else if (this.isLocalVideoMuted() === mute) {
|
834
|
837
|
// NO-OP
|
835
|
838
|
return;
|
836
|
839
|
}
|
|
@@ -841,7 +844,10 @@ export default {
|
841
|
844
|
}
|
842
|
845
|
};
|
843
|
846
|
|
844
|
|
- if (!localVideo && this.videoMuted && !mute) {
|
|
847
|
+ // FIXME it is possible to queue this task twice, but it's not causing
|
|
848
|
+ // any issues. Specifically this can happen when the previous
|
|
849
|
+ // get user media call is blocked on "ask user for permissions" dialog.
|
|
850
|
+ if (!this.localVideo && !mute) {
|
845
|
851
|
// Try to create local video if there wasn't any.
|
846
|
852
|
// This handles the case when user joined with no video
|
847
|
853
|
// (dismissed screen sharing screen or in audio only mode), but
|
|
@@ -861,14 +867,8 @@ export default {
|
861
|
867
|
})
|
862
|
868
|
.then(videoTrack => this.useVideoStream(videoTrack));
|
863
|
869
|
} else {
|
864
|
|
- const oldMutedStatus = this.videoMuted;
|
865
|
|
-
|
866
|
|
- muteLocalVideo(mute)
|
867
|
|
- .catch(error => {
|
868
|
|
- maybeShowErrorDialog(error);
|
869
|
|
- this.setVideoMuteStatus(oldMutedStatus);
|
870
|
|
- APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
|
871
|
|
- });
|
|
870
|
+ // FIXME show error dialog if it fails (should be handled by react)
|
|
871
|
+ muteLocalVideo(mute);
|
872
|
872
|
}
|
873
|
873
|
},
|
874
|
874
|
/**
|
|
@@ -877,7 +877,7 @@ export default {
|
877
|
877
|
* dialogs in case of media permissions error.
|
878
|
878
|
*/
|
879
|
879
|
toggleVideoMuted(showUI = true) {
|
880
|
|
- this.muteVideo(!this.videoMuted, showUI);
|
|
880
|
+ this.muteVideo(!this.isLocalVideoMuted(), showUI);
|
881
|
881
|
},
|
882
|
882
|
/**
|
883
|
883
|
* Retrieve list of conference participants (without local user).
|
|
@@ -1202,7 +1202,7 @@ export default {
|
1202
|
1202
|
|
1203
|
1203
|
_getConferenceOptions() {
|
1204
|
1204
|
let options = config;
|
1205
|
|
- if(config.enableRecording && !config.recordingType) {
|
|
1205
|
+ if (config.enableRecording && !config.recordingType) {
|
1206
|
1206
|
options.recordingType = (config.hosts &&
|
1207
|
1207
|
(typeof config.hosts.jirecon != "undefined"))?
|
1208
|
1208
|
"jirecon" : "colibri";
|
|
@@ -1219,20 +1219,18 @@ export default {
|
1219
|
1219
|
*/
|
1220
|
1220
|
useVideoStream(newStream) {
|
1221
|
1221
|
return APP.store.dispatch(
|
1222
|
|
- replaceLocalTrack(localVideo, newStream, room))
|
|
1222
|
+ replaceLocalTrack(this.localVideo, newStream, room))
|
1223
|
1223
|
.then(() => {
|
1224
|
|
- localVideo = newStream;
|
|
1224
|
+ this.localVideo = newStream;
|
|
1225
|
+
|
1225
|
1226
|
if (newStream) {
|
1226
|
|
- this.setVideoMuteStatus(newStream.isMuted());
|
1227
|
1227
|
this.isSharingScreen = newStream.videoType === 'desktop';
|
1228
|
1228
|
|
1229
|
1229
|
APP.UI.addLocalStream(newStream);
|
1230
|
1230
|
} else {
|
1231
|
|
- // No video is treated the same way as being video muted
|
1232
|
|
- this.setVideoMuteStatus(true);
|
1233
|
1231
|
this.isSharingScreen = false;
|
1234
|
1232
|
}
|
1235
|
|
- APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
|
|
1233
|
+ this.setVideoMuteStatus(this.isLocalVideoMuted());
|
1236
|
1234
|
APP.UI.updateDesktopSharingButtons();
|
1237
|
1235
|
});
|
1238
|
1236
|
},
|
|
@@ -1245,18 +1243,13 @@ export default {
|
1245
|
1243
|
*/
|
1246
|
1244
|
useAudioStream(newStream) {
|
1247
|
1245
|
return APP.store.dispatch(
|
1248
|
|
- replaceLocalTrack(localAudio, newStream, room))
|
|
1246
|
+ replaceLocalTrack(this.localAudio, newStream, room))
|
1249
|
1247
|
.then(() => {
|
1250
|
|
- localAudio = newStream;
|
1251
|
|
-
|
|
1248
|
+ this.localAudio = newStream;
|
1252
|
1249
|
if (newStream) {
|
1253
|
|
- this.setAudioMuteStatus(newStream.isMuted());
|
1254
|
1250
|
APP.UI.addLocalStream(newStream);
|
1255
|
|
- } else {
|
1256
|
|
- // No audio is treated the same way as being audio muted
|
1257
|
|
- this.setAudioMuteStatus(true);
|
1258
|
1251
|
}
|
1259
|
|
- APP.UI.setAudioMuted(this.getMyUserId(), this.audioMuted);
|
|
1252
|
+ this.setAudioMuteStatus(this.isLocalAudioMuted());
|
1260
|
1253
|
});
|
1261
|
1254
|
},
|
1262
|
1255
|
|
|
@@ -1339,10 +1332,10 @@ export default {
|
1339
|
1332
|
JitsiMeetJS.analytics.sendEvent(
|
1340
|
1333
|
'conference.sharingDesktop.stop');
|
1341
|
1334
|
logger.log('switched back to local video');
|
1342
|
|
- if (!localVideo && wasVideoMuted) {
|
|
1335
|
+ if (!this.localVideo && wasVideoMuted) {
|
1343
|
1336
|
return Promise.reject('No local video to be muted!');
|
1344
|
|
- } else if (wasVideoMuted && localVideo) {
|
1345
|
|
- return localVideo.mute();
|
|
1337
|
+ } else if (wasVideoMuted && this.localVideo) {
|
|
1338
|
+ return this.localVideo.mute();
|
1346
|
1339
|
}
|
1347
|
1340
|
})
|
1348
|
1341
|
.catch(error => {
|
|
@@ -1416,8 +1409,8 @@ export default {
|
1416
|
1409
|
_createDesktopTrack(options = {}) {
|
1417
|
1410
|
let externalInstallation = false;
|
1418
|
1411
|
let DSExternalInstallationInProgress = false;
|
1419
|
|
- const didHaveVideo = Boolean(localVideo);
|
1420
|
|
- const wasVideoMuted = this.videoMuted;
|
|
1412
|
+ const didHaveVideo = Boolean(this.localVideo);
|
|
1413
|
+ const wasVideoMuted = this.isLocalVideoMuted();
|
1421
|
1414
|
|
1422
|
1415
|
return createLocalTracks({
|
1423
|
1416
|
desktopSharingSources: options.desktopSharingSources,
|
|
@@ -1671,28 +1664,28 @@ export default {
|
1671
|
1664
|
});
|
1672
|
1665
|
|
1673
|
1666
|
room.on(ConferenceEvents.TRACK_ADDED, (track) => {
|
1674
|
|
- if(!track || track.isLocal())
|
|
1667
|
+ if (!track || track.isLocal())
|
1675
|
1668
|
return;
|
1676
|
1669
|
|
1677
|
1670
|
APP.store.dispatch(trackAdded(track));
|
1678
|
1671
|
});
|
1679
|
1672
|
|
1680
|
1673
|
room.on(ConferenceEvents.TRACK_REMOVED, (track) => {
|
1681
|
|
- if(!track || track.isLocal())
|
|
1674
|
+ if (!track || track.isLocal())
|
1682
|
1675
|
return;
|
1683
|
1676
|
|
1684
|
1677
|
APP.store.dispatch(trackRemoved(track));
|
1685
|
1678
|
});
|
1686
|
1679
|
|
1687
|
1680
|
room.on(ConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED, (id, lvl) => {
|
1688
|
|
- if(this.isLocalId(id) && localAudio && localAudio.isMuted()) {
|
|
1681
|
+ if (this.isLocalId(id)
|
|
1682
|
+ && this.localAudio && this.localAudio.isMuted()) {
|
1689
|
1683
|
lvl = 0;
|
1690
|
1684
|
}
|
1691
|
1685
|
|
1692
|
|
- if(config.debug)
|
1693
|
|
- {
|
|
1686
|
+ if (config.debug) {
|
1694
|
1687
|
this.audioLevelsMap[id] = lvl;
|
1695
|
|
- if(config.debugAudioLevels)
|
|
1688
|
+ if (config.debugAudioLevels)
|
1696
|
1689
|
logger.log("AudioLevel:" + id + "/" + lvl);
|
1697
|
1690
|
}
|
1698
|
1691
|
|
|
@@ -1866,12 +1859,14 @@ export default {
|
1866
|
1859
|
this.deviceChangeListener);
|
1867
|
1860
|
|
1868
|
1861
|
// stop local video
|
1869
|
|
- if (localVideo) {
|
1870
|
|
- localVideo.dispose();
|
|
1862
|
+ if (this.localVideo) {
|
|
1863
|
+ this.localVideo.dispose();
|
|
1864
|
+ this.localVideo = null;
|
1871
|
1865
|
}
|
1872
|
1866
|
// stop local audio
|
1873
|
|
- if (localAudio) {
|
1874
|
|
- localAudio.dispose();
|
|
1867
|
+ if (this.localAudio) {
|
|
1868
|
+ this.localAudio.dispose();
|
|
1869
|
+ this.localAudio = null;
|
1875
|
1870
|
}
|
1876
|
1871
|
});
|
1877
|
1872
|
|
|
@@ -2215,14 +2210,14 @@ export default {
|
2215
|
2210
|
// storage and settings menu. This is a workaround until
|
2216
|
2211
|
// getConstraints() method will be implemented
|
2217
|
2212
|
// in browsers.
|
2218
|
|
- if (localAudio) {
|
|
2213
|
+ if (this.localAudio) {
|
2219
|
2214
|
APP.settings.setMicDeviceId(
|
2220
|
|
- localAudio.getDeviceId(), false);
|
|
2215
|
+ this.localAudio.getDeviceId(), false);
|
2221
|
2216
|
}
|
2222
|
2217
|
|
2223
|
|
- if (localVideo) {
|
|
2218
|
+ if (this.localVideo) {
|
2224
|
2219
|
APP.settings.setCameraDeviceId(
|
2225
|
|
- localVideo.getDeviceId(), false);
|
|
2220
|
+ this.localVideo.getDeviceId(), false);
|
2226
|
2221
|
}
|
2227
|
2222
|
|
2228
|
2223
|
mediaDeviceHelper.setCurrentMediaDevices(devices);
|
|
@@ -2263,10 +2258,13 @@ export default {
|
2263
|
2258
|
|
2264
|
2259
|
let newDevices =
|
2265
|
2260
|
mediaDeviceHelper.getNewMediaDevicesAfterDeviceListChanged(
|
2266
|
|
- devices, this.isSharingScreen, localVideo, localAudio);
|
|
2261
|
+ devices,
|
|
2262
|
+ this.isSharingScreen,
|
|
2263
|
+ this.localVideo,
|
|
2264
|
+ this.localAudio);
|
2267
|
2265
|
let promises = [];
|
2268
|
|
- let audioWasMuted = this.audioMuted;
|
2269
|
|
- let videoWasMuted = this.videoMuted;
|
|
2266
|
+ let audioWasMuted = this.isLocalAudioMuted();
|
|
2267
|
+ let videoWasMuted = this.isLocalVideoMuted();
|
2270
|
2268
|
let availableAudioInputDevices =
|
2271
|
2269
|
mediaDeviceHelper.getDevicesFromListByKind(devices, 'audioinput');
|
2272
|
2270
|
let availableVideoInputDevices =
|
|
@@ -2323,11 +2321,11 @@ export default {
|
2323
|
2321
|
|
2324
|
2322
|
// The audio functionality is considered available if there are any
|
2325
|
2323
|
// audio devices detected or if the local audio stream already exists.
|
2326
|
|
- const available = audioDeviceCount > 0 || Boolean(localAudio);
|
|
2324
|
+ const available = audioDeviceCount > 0 || Boolean(this.localAudio);
|
2327
|
2325
|
|
2328
|
2326
|
logger.debug(
|
2329
|
2327
|
'Microphone button enabled: ' + available,
|
2330
|
|
- 'local audio: ' + localAudio,
|
|
2328
|
+ 'local audio: ' + this.localAudio,
|
2331
|
2329
|
'audio devices: ' + audioMediaDevices,
|
2332
|
2330
|
'device count: ' + audioDeviceCount);
|
2333
|
2331
|
|
|
@@ -2348,11 +2346,11 @@ export default {
|
2348
|
2346
|
// active which could be either screensharing stream or a video track
|
2349
|
2347
|
// created before the permissions were rejected (through browser
|
2350
|
2348
|
// config).
|
2351
|
|
- const available = videoDeviceCount > 0 || Boolean(localVideo);
|
|
2349
|
+ const available = videoDeviceCount > 0 || Boolean(this.localVideo);
|
2352
|
2350
|
|
2353
|
2351
|
logger.debug(
|
2354
|
2352
|
'Camera button enabled: ' + available,
|
2355
|
|
- 'local video: ' + localVideo,
|
|
2353
|
+ 'local video: ' + this.localVideo,
|
2356
|
2354
|
'video devices: ' + videoMediaDevices,
|
2357
|
2355
|
'device count: ' + videoDeviceCount);
|
2358
|
2356
|
|
|
@@ -2393,10 +2391,10 @@ export default {
|
2393
|
2391
|
* NOTE: Should be used after conference.init
|
2394
|
2392
|
*/
|
2395
|
2393
|
logEvent(name, value, label) {
|
2396
|
|
- if(JitsiMeetJS.analytics) {
|
|
2394
|
+ if (JitsiMeetJS.analytics) {
|
2397
|
2395
|
JitsiMeetJS.analytics.sendEvent(name, {value, label});
|
2398
|
2396
|
}
|
2399
|
|
- if(room) {
|
|
2397
|
+ if (room) {
|
2400
|
2398
|
room.sendApplicationLog(JSON.stringify({name, value, label}));
|
2401
|
2399
|
}
|
2402
|
2400
|
},
|
|
@@ -2553,7 +2551,7 @@ export default {
|
2553
|
2551
|
* track or the source id is not available, undefined will be returned.
|
2554
|
2552
|
*/
|
2555
|
2553
|
getDesktopSharingSourceId() {
|
2556
|
|
- return localVideo.sourceId;
|
|
2554
|
+ return this.localVideo.sourceId;
|
2557
|
2555
|
},
|
2558
|
2556
|
|
2559
|
2557
|
/**
|
|
@@ -2565,7 +2563,7 @@ export default {
|
2565
|
2563
|
* returned.
|
2566
|
2564
|
*/
|
2567
|
2565
|
getDesktopSharingSourceType() {
|
2568
|
|
- return localVideo.sourceType;
|
|
2566
|
+ return this.localVideo.sourceType;
|
2569
|
2567
|
},
|
2570
|
2568
|
|
2571
|
2569
|
/**
|
|
@@ -2574,10 +2572,8 @@ export default {
|
2574
|
2572
|
* @param {boolean} muted - New muted status.
|
2575
|
2573
|
*/
|
2576
|
2574
|
setVideoMuteStatus(muted) {
|
2577
|
|
- if (this.videoMuted !== muted) {
|
2578
|
|
- this.videoMuted = muted;
|
2579
|
|
- APP.API.notifyVideoMutedStatusChanged(muted);
|
2580
|
|
- }
|
|
2575
|
+ APP.UI.setVideoMuted(this.getMyUserId(), muted);
|
|
2576
|
+ APP.API.notifyVideoMutedStatusChanged(muted);
|
2581
|
2577
|
},
|
2582
|
2578
|
|
2583
|
2579
|
/**
|
|
@@ -2586,9 +2582,7 @@ export default {
|
2586
|
2582
|
* @param {boolean} muted - New muted status.
|
2587
|
2583
|
*/
|
2588
|
2584
|
setAudioMuteStatus(muted) {
|
2589
|
|
- if (this.audioMuted !== muted) {
|
2590
|
|
- this.audioMuted = muted;
|
2591
|
|
- APP.API.notifyAudioMutedStatusChanged(muted);
|
2592
|
|
- }
|
2593
|
|
- },
|
|
2585
|
+ APP.UI.setAudioMuted(this.getMyUserId(), muted);
|
|
2586
|
+ APP.API.notifyAudioMutedStatusChanged(muted);
|
|
2587
|
+ }
|
2594
|
2588
|
};
|