|
@@ -63,7 +63,8 @@ const ConnectionQualityEvents = JitsiMeetJS.events.connectionQuality;
|
63
|
63
|
|
64
|
64
|
const eventEmitter = new EventEmitter();
|
65
|
65
|
|
66
|
|
-let room, connection, localAudio, localVideo;
|
|
66
|
+let room, connection, localAudio, localVideo,
|
|
67
|
+ initialAudioMutedState = false, initialVideoMutedState = false;
|
67
|
68
|
|
68
|
69
|
/**
|
69
|
70
|
* Indicates whether extension external installation is in progress or not.
|
|
@@ -581,6 +582,12 @@ export default {
|
581
|
582
|
analytics.init();
|
582
|
583
|
return createInitialLocalTracksAndConnect(options.roomName);
|
583
|
584
|
}).then(([tracks, con]) => {
|
|
585
|
+ tracks.forEach(track => {
|
|
586
|
+ if((track.isAudioTrack() && initialAudioMutedState)
|
|
587
|
+ || (track.isVideoTrack() && initialVideoMutedState)) {
|
|
588
|
+ track.mute();
|
|
589
|
+ }
|
|
590
|
+ });
|
584
|
591
|
logger.log('initialized with %s local tracks', tracks.length);
|
585
|
592
|
con.addEventListener(
|
586
|
593
|
ConnectionEvents.CONNECTION_FAILED,
|
|
@@ -648,9 +655,17 @@ export default {
|
648
|
655
|
return this.audioMuted;
|
649
|
656
|
},
|
650
|
657
|
/**
|
651
|
|
- * Simulates toolbar button click for audio mute. Used by shortcuts and API.
|
|
658
|
+ * Simulates toolbar button click for audio mute. Used by shortcuts
|
|
659
|
+ * and API.
|
|
660
|
+ * @param {boolean} force - If the track is not created, the operation
|
|
661
|
+ * will be executed after the track is created. Otherwise the operation
|
|
662
|
+ * will be ignored.
|
652
|
663
|
*/
|
653
|
|
- toggleAudioMuted () {
|
|
664
|
+ toggleAudioMuted (force = false) {
|
|
665
|
+ if(!localAudio && force) {
|
|
666
|
+ initialAudioMutedState = !initialAudioMutedState;
|
|
667
|
+ return;
|
|
668
|
+ }
|
654
|
669
|
this.muteAudio(!this.audioMuted);
|
655
|
670
|
},
|
656
|
671
|
/**
|
|
@@ -662,8 +677,15 @@ export default {
|
662
|
677
|
},
|
663
|
678
|
/**
|
664
|
679
|
* Simulates toolbar button click for video mute. Used by shortcuts and API.
|
|
680
|
+ * @param {boolean} force - If the track is not created, the operation
|
|
681
|
+ * will be executed after the track is created. Otherwise the operation
|
|
682
|
+ * will be ignored.
|
665
|
683
|
*/
|
666
|
|
- toggleVideoMuted () {
|
|
684
|
+ toggleVideoMuted (force = false) {
|
|
685
|
+ if(!localVideo && force) {
|
|
686
|
+ initialVideoMutedState = !initialVideoMutedState;
|
|
687
|
+ return;
|
|
688
|
+ }
|
667
|
689
|
this.muteVideo(!this.videoMuted);
|
668
|
690
|
},
|
669
|
691
|
/**
|