Sfoglia il codice sorgente

feat(API): add dominant speaker changed event

Fixes: https://github.com/jitsi/jitsi-meet/issues/4049
master
Karthik Muralidharan 5 anni fa
parent
commit
b658f20a30

+ 7
- 0
doc/api.md Vedi File

322
 }
322
 }
323
 ```
323
 ```
324
 
324
 
325
+* **dominantSpeakerChanged** - receives event notifications about change in the dominant speaker. The listener will receive object with the following structure:
326
+```javascript
327
+{
328
+    id: string //participantId of the new dominant speaker
329
+}
330
+```
331
+
325
 * **tileViewChanged** - event notifications about tile view layout mode being entered or exited. The listener will receive object with the following structure:
332
 * **tileViewChanged** - event notifications about tile view layout mode being entered or exited. The listener will receive object with the following structure:
326
 ```javascript
333
 ```javascript
327
 {
334
 {

+ 14
- 0
modules/API/API.js Vedi File

709
         });
709
         });
710
     }
710
     }
711
 
711
 
712
+    /**
713
+     * Notify external application (if API is enabled) that the dominant speaker
714
+     * has been turned on/off.
715
+     *
716
+     * @param {string} id - Id of the dominant participant.
717
+     * @returns {void}
718
+     */
719
+    notifyDominantSpeakerChanged(id: string) {
720
+        this._sendEvent({
721
+            name: 'dominant-speaker-changed',
722
+            id
723
+        });
724
+    }
725
+
712
     /**
726
     /**
713
      * Notify external application (if API is enabled) that the conference
727
      * Notify external application (if API is enabled) that the conference
714
      * changed their subject.
728
      * changed their subject.

+ 9
- 2
modules/API/external/external_api.js Vedi File

73
     'video-availability-changed': 'videoAvailabilityChanged',
73
     'video-availability-changed': 'videoAvailabilityChanged',
74
     'video-mute-status-changed': 'videoMuteStatusChanged',
74
     'video-mute-status-changed': 'videoMuteStatusChanged',
75
     'screen-sharing-status-changed': 'screenSharingStatusChanged',
75
     'screen-sharing-status-changed': 'screenSharingStatusChanged',
76
+    'dominant-speaker-changed': 'dominantSpeakerChanged',
76
     'subject-change': 'subjectChange',
77
     'subject-change': 'subjectChange',
77
     'suspend-detected': 'suspendDetected',
78
     'suspend-detected': 'suspendDetected',
78
     'tile-view-changed': 'tileViewChanged'
79
     'tile-view-changed': 'tileViewChanged'
521
      * {{
522
      * {{
522
      * jid: jid //the jid of the participant
523
      * jid: jid //the jid of the participant
523
      * }}
524
      * }}
524
-     * {@code video-conference-joined} - receives event notifications about the
525
+     * {@code videoConferenceJoined} - receives event notifications about the
525
      * local user has successfully joined the video conference.
526
      * local user has successfully joined the video conference.
526
      * The listener will receive object with the following structure:
527
      * The listener will receive object with the following structure:
527
      * {{
528
      * {{
528
      * roomName: room //the room name of the conference
529
      * roomName: room //the room name of the conference
529
      * }}
530
      * }}
530
-     * {@code video-conference-left} - receives event notifications about the
531
+     * {@code videoConferenceLeft} - receives event notifications about the
531
      * local user has left the video conference.
532
      * local user has left the video conference.
532
      * The listener will receive object with the following structure:
533
      * The listener will receive object with the following structure:
533
      * {{
534
      * {{
539
      * {{
540
      * {{
540
      * on: on //whether screen sharing is on
541
      * on: on //whether screen sharing is on
541
      * }}
542
      * }}
543
+     * {@code dominantSpeakerChanged} - receives event notifications about
544
+     * change in the dominant speaker.
545
+     * The listener will receive object with the following structure:
546
+     * {{
547
+     * id: participantId //participantId of the new dominant speaker
548
+     * }}
542
      * {@code suspendDetected} - receives event notifications about detecting suspend event in host computer.
549
      * {@code suspendDetected} - receives event notifications about detecting suspend event in host computer.
543
      * {@code readyToClose} - all hangup operations are completed and Jitsi Meet
550
      * {@code readyToClose} - all hangup operations are completed and Jitsi Meet
544
      * is ready to be disposed.
551
      * is ready to be disposed.

+ 5
- 0
react/features/external-api/middleware.js Vedi File

8
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
8
 import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
9
 import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
9
 import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
10
 import {
10
 import {
11
+    DOMINANT_SPEAKER_CHANGED,
11
     PARTICIPANT_KICKED,
12
     PARTICIPANT_KICKED,
12
     PARTICIPANT_LEFT,
13
     PARTICIPANT_LEFT,
13
     PARTICIPANT_JOINED,
14
     PARTICIPANT_JOINED,
99
         break;
100
         break;
100
     }
101
     }
101
 
102
 
103
+    case DOMINANT_SPEAKER_CHANGED:
104
+        APP.API.notifyDominantSpeakerChanged(action.participant.id);
105
+        break;
106
+
102
     case KICKED_OUT:
107
     case KICKED_OUT:
103
         APP.API.notifyKickedOut(
108
         APP.API.notifyKickedOut(
104
             {
109
             {

Loading…
Annulla
Salva