浏览代码

feat(dominantSpeaker): Add previous speaker list.

dev1
Jaya Allamsetty 4 年前
父节点
当前提交
6288f72df0
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 9 次插入11 次删除
  1. 6
    7
      JitsiConferenceEventManager.js
  2. 3
    4
      modules/RTC/BridgeChannel.js

+ 6
- 7
JitsiConferenceEventManager.js 查看文件

490
         conference.onRemoteTrackRemoved.bind(conference));
490
         conference.onRemoteTrackRemoved.bind(conference));
491
 
491
 
492
     rtc.addListener(RTCEvents.DOMINANT_SPEAKER_CHANGED,
492
     rtc.addListener(RTCEvents.DOMINANT_SPEAKER_CHANGED,
493
-        id => {
494
-            if (conference.lastDominantSpeaker !== id && conference.room) {
495
-                conference.lastDominantSpeaker = id;
493
+        (dominant, previous) => {
494
+            if (conference.lastDominantSpeaker !== dominant && conference.room) {
495
+                conference.lastDominantSpeaker = dominant;
496
                 conference.eventEmitter.emit(
496
                 conference.eventEmitter.emit(
497
-                    JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, id);
497
+                    JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, dominant, previous);
498
 
498
 
499
-                if (conference.statistics && conference.myUserId() === id) {
499
+                if (conference.statistics && conference.myUserId() === dominant) {
500
                     // We are the new dominant speaker.
500
                     // We are the new dominant speaker.
501
-                    conference.statistics.sendDominantSpeakerEvent(
502
-                        conference.room.roomjid);
501
+                    conference.statistics.sendDominantSpeakerEvent(conference.room.roomjid);
503
                 }
502
                 }
504
             }
503
             }
505
         });
504
         });

+ 3
- 4
modules/RTC/BridgeChannel.js 查看文件

290
 
290
 
291
             switch (colibriClass) {
291
             switch (colibriClass) {
292
             case 'DominantSpeakerEndpointChangeEvent': {
292
             case 'DominantSpeakerEndpointChangeEvent': {
293
-                // Endpoint ID from the Videobridge.
294
-                const dominantSpeakerEndpoint = obj.dominantSpeakerEndpoint;
293
+                const { dominantSpeakerEndpoint, previousSpeakers = [] } = obj;
295
 
294
 
296
-                logger.info(`New dominant speaker: ${dominantSpeakerEndpoint}.`);
297
-                emitter.emit(RTCEvents.DOMINANT_SPEAKER_CHANGED, dominantSpeakerEndpoint);
295
+                logger.debug(`Dominant speaker: ${dominantSpeakerEndpoint}, previous speakers: ${previousSpeakers}`);
296
+                emitter.emit(RTCEvents.DOMINANT_SPEAKER_CHANGED, dominantSpeakerEndpoint, previousSpeakers);
298
                 break;
297
                 break;
299
             }
298
             }
300
             case 'EndpointConnectivityStatusChangeEvent': {
299
             case 'EndpointConnectivityStatusChangeEvent': {

正在加载...
取消
保存