Просмотр исходного кода

unmute client on the server if he was muted by focus

master
Ivan Symchych 9 лет назад
Родитель
Сommit
abf617e945
1 измененных файлов: 8 добавлений и 0 удалений
  1. 8
    0
      JitsiConference.js

+ 8
- 0
JitsiConference.js Просмотреть файл

@@ -61,6 +61,7 @@ function JitsiConference(options) {
61 61
         audio: undefined,
62 62
         video: undefined
63 63
     };
64
+    this.isMutedByFocus = false;
64 65
 }
65 66
 
66 67
 /**
@@ -308,6 +309,12 @@ JitsiConference.prototype._fireAudioLevelChangeEvent = function (audioLevel) {
308 309
  * @param track the JitsiTrack object related to the event.
309 310
  */
310 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 318
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track);
312 319
 };
313 320
 
@@ -794,6 +801,7 @@ function setupListeners(conference) {
794 801
     conference.room.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS,
795 802
         function (value) {
796 803
             conference.rtc.setAudioMute(value);
804
+            conference.isMutedByFocus = true;
797 805
         }
798 806
     );
799 807
 

Загрузка…
Отмена
Сохранить