Kaynağa Gözat

feat(dominantSpeaker): Add previous speaker list.

dev1
Jaya Allamsetty 4 yıl önce
ebeveyn
işleme
6288f72df0
No account linked to committer's email address
2 değiştirilmiş dosya ile 9 ekleme ve 11 silme
  1. 6
    7
      JitsiConferenceEventManager.js
  2. 3
    4
      modules/RTC/BridgeChannel.js

+ 6
- 7
JitsiConferenceEventManager.js Dosyayı Görüntüle

@@ -490,16 +490,15 @@ JitsiConferenceEventManager.prototype.setupRTCListeners = function() {
490 490
         conference.onRemoteTrackRemoved.bind(conference));
491 491
 
492 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 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 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 Dosyayı Görüntüle

@@ -290,11 +290,10 @@ export default class BridgeChannel {
290 290
 
291 291
             switch (colibriClass) {
292 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 297
                 break;
299 298
             }
300 299
             case 'EndpointConnectivityStatusChangeEvent': {

Loading…
İptal
Kaydet