浏览代码

Fixes sending speakerstats for p2p and fix sending only when needed.

dev1
damencho 6 年前
父节点
当前提交
fd16c566b6
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 6
    5
      JitsiConferenceEventManager.js
  2. 3
    2
      modules/P2PDominantSpeakerDetection.js

+ 6
- 5
JitsiConferenceEventManager.js 查看文件

@@ -429,11 +429,12 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
429 429
                 conference.lastDominantSpeaker = id;
430 430
                 conference.eventEmitter.emit(
431 431
                     JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, id);
432
-            }
433
-            if (conference.statistics && conference.myUserId() === id) {
434
-                // We are the new dominant speaker.
435
-                conference.statistics.sendDominantSpeakerEvent(
436
-                    conference.room.roomjid);
432
+
433
+                if (conference.statistics && conference.myUserId() === id) {
434
+                    // We are the new dominant speaker.
435
+                    conference.statistics.sendDominantSpeakerEvent(
436
+                        conference.room.roomjid);
437
+                }
437 438
             }
438 439
         });
439 440
 

+ 3
- 2
modules/P2PDominantSpeakerDetection.js 查看文件

@@ -1,4 +1,5 @@
1 1
 import * as JitsiConferenceEvents from '../JitsiConferenceEvents';
2
+import RTCEvents from '../service/RTC/RTCEvents';
2 3
 
3 4
 /**
4 5
  * The value which we use to say, every sound over this threshold
@@ -49,8 +50,8 @@ export default class P2PDominantSpeakerDetection {
49 50
             return;
50 51
         }
51 52
 
52
-        this.conference.eventEmitter.emit(
53
-            JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
53
+        this.conference.rtc.eventEmitter.emit(
54
+            RTCEvents.DOMINANT_SPEAKER_CHANGED,
54 55
             id);
55 56
     }
56 57
 }

正在加载...
取消
保存