Sfoglia il codice sorgente

feat: emit raise hand event to external API (#8312)

* Expose raise hand event to external application

* Fix linting issues

* fix the app non existing issue
master
Asif 4 anni fa
parent
commit
cd29f10fa8
Nessun account collegato all'indirizzo email del committer

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

1022
         });
1022
         });
1023
     }
1023
     }
1024
 
1024
 
1025
+    /**
1026
+     * Notify external application (if API is enabled) that user updated their hand raised.
1027
+     *
1028
+     * @param {string} id - User id.
1029
+     * @param {boolean} handRaised - Whether user has raised hand.
1030
+     * @returns {void}
1031
+     */
1032
+    notifyRaiseHandUpdated(id: string, handRaised: boolean) {
1033
+        this._sendEvent({
1034
+            name: 'raise-hand-updated',
1035
+            handRaised,
1036
+            id
1037
+        });
1038
+    }
1039
+
1025
     /**
1040
     /**
1026
      * Disposes the allocated resources.
1041
      * Disposes the allocated resources.
1027
      *
1042
      *

+ 1
- 0
modules/API/external/external_api.js Vedi File

79
     'participant-role-changed': 'participantRoleChanged',
79
     'participant-role-changed': 'participantRoleChanged',
80
     'password-required': 'passwordRequired',
80
     'password-required': 'passwordRequired',
81
     'proxy-connection-event': 'proxyConnectionEvent',
81
     'proxy-connection-event': 'proxyConnectionEvent',
82
+    'raise-hand-updated': 'raiseHandUpdated',
82
     'video-ready-to-close': 'readyToClose',
83
     'video-ready-to-close': 'readyToClose',
83
     'video-conference-joined': 'videoConferenceJoined',
84
     'video-conference-joined': 'videoConferenceJoined',
84
     'video-conference-left': 'videoConferenceLeft',
85
     'video-conference-left': 'videoConferenceLeft',

+ 4
- 0
react/features/base/participants/middleware.js Vedi File

448
         raisedHand
448
         raisedHand
449
     }));
449
     }));
450
 
450
 
451
+    if (typeof APP !== 'undefined') {
452
+        APP.API.notifyRaiseHandUpdated(participantId, raisedHand);
453
+    }
454
+
451
     if (raisedHand) {
455
     if (raisedHand) {
452
         dispatch(showNotification({
456
         dispatch(showNotification({
453
             titleArguments: {
457
             titleArguments: {

+ 4
- 1
react/features/toolbox/components/web/Toolbox.js Vedi File

470
      */
470
      */
471
     _doToggleRaiseHand() {
471
     _doToggleRaiseHand() {
472
         const { _localParticipantID, _raisedHand } = this.props;
472
         const { _localParticipantID, _raisedHand } = this.props;
473
+        const newRaisedStatus = !_raisedHand;
473
 
474
 
474
         this.props.dispatch(participantUpdated({
475
         this.props.dispatch(participantUpdated({
475
             // XXX Only the local participant is allowed to update without
476
             // XXX Only the local participant is allowed to update without
480
 
481
 
481
             id: _localParticipantID,
482
             id: _localParticipantID,
482
             local: true,
483
             local: true,
483
-            raisedHand: !_raisedHand
484
+            raisedHand: newRaisedStatus
484
         }));
485
         }));
486
+
487
+        APP.API.notifyRaiseHandUpdated(_localParticipantID, newRaisedStatus);
485
     }
488
     }
486
 
489
 
487
     /**
490
     /**

Loading…
Annulla
Salva