瀏覽代碼

Adds a property to disable/enable talk while muted.

By default talk while muted detection is disabled.
dev1
damencho 9 年之前
父節點
當前提交
0f52b939b7
共有 2 個檔案被更改,包括 12 行新增9 行删除
  1. 11
    9
      JitsiConference.js
  2. 1
    0
      doc/API.md

+ 11
- 9
JitsiConference.js 查看文件

@@ -116,15 +116,17 @@ JitsiConference.prototype._init = function (options) {
116 116
     // listeners are removed from statistics module.
117 117
     this.eventManager.setupStatisticsListeners();
118 118
 
119
-    this.talkMutedDetection = new TalkMutedDetection(function () {
120
-        this.eventEmitter.emit(JitsiConferenceEvents.TALK_WHILE_MUTED);
121
-    }.bind(this));
122
-    this.statistics.addAudioLevelListener(
123
-        this.talkMutedDetection.audioLevelListener
124
-            .bind(this.talkMutedDetection));
125
-    this.eventEmitter.on(
126
-        JitsiConferenceEvents.TRACK_MUTE_CHANGED,
127
-        this.talkMutedDetection.muteChanged.bind(this.talkMutedDetection));
119
+    if (this.options.config.enableTalkWhileMuted) {
120
+        this.talkMutedDetection = new TalkMutedDetection(function () {
121
+            this.eventEmitter.emit(JitsiConferenceEvents.TALK_WHILE_MUTED);
122
+        }.bind(this));
123
+        this.statistics.addAudioLevelListener(
124
+            this.talkMutedDetection.audioLevelListener
125
+                .bind(this.talkMutedDetection));
126
+        this.eventEmitter.on(
127
+            JitsiConferenceEvents.TRACK_MUTE_CHANGED,
128
+            this.talkMutedDetection.muteChanged.bind(this.talkMutedDetection));
129
+    }
128 130
 }
129 131
 
130 132
 /**

+ 1
- 0
doc/API.md 查看文件

@@ -219,6 +219,7 @@ This objects represents the server connection. You can create new ```JitsiConnec
219 219
         3. jirecon
220 220
         4. callStatsID - callstats credentials
221 221
         5. callStatsSecret - callstats credentials
222
+        6. enableTalkWhileMuted - boolean property. Enables/disables talk while muted detection, by default the value is false/disabled.
222 223
         **NOTE: if 4 and 5 are set the library is going to send events to callstats. Otherwise the callstats integration will be disabled.**
223 224
 
224 225
 5. addEventListener(event, listener) - Subscribes the passed listener to the event.

Loading…
取消
儲存