浏览代码

unmute client on the server if he was muted by focus

master
Ivan Symchych 9 年前
父节点
当前提交
abf617e945
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      JitsiConference.js

+ 8
- 0
JitsiConference.js 查看文件

61
         audio: undefined,
61
         audio: undefined,
62
         video: undefined
62
         video: undefined
63
     };
63
     };
64
+    this.isMutedByFocus = false;
64
 }
65
 }
65
 
66
 
66
 /**
67
 /**
308
  * @param track the JitsiTrack object related to the event.
309
  * @param track the JitsiTrack object related to the event.
309
  */
310
  */
310
 JitsiConference.prototype._fireMuteChangeEvent = function (track) {
311
 JitsiConference.prototype._fireMuteChangeEvent = function (track) {
312
+    // check if track was muted by focus and now is unmuted by user
313
+    if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
314
+        this.isMutedByFocus = false;
315
+        // unmute local user on server
316
+        this.room.muteParticipant(this.room.myroomjid, false);
317
+    }
311
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track);
318
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track);
312
 };
319
 };
313
 
320
 
794
     conference.room.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
801
     conference.room.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
795
         function (value) {
802
         function (value) {
796
             conference.rtc.setAudioMute(value);
803
             conference.rtc.setAudioMute(value);
804
+            conference.isMutedByFocus = true;
797
         }
805
         }
798
     );
806
     );
799
 
807
 

正在加载...
取消
保存