Bläddra i källkod

feat(api): add notification for when filmstrip gets toggled (#3974)

j8
virtuacoplenny 6 år sedan
förälder
incheckning
22277ad799
Inget konto är kopplat till bidragsgivarens mejladress

+ 6
- 0
doc/api.md Visa fil

@@ -214,6 +214,12 @@ changes. The listener will receive an object with the following structure:
214 214
 "email": email // the new email
215 215
 }
216 216
 ```
217
+* **filmstripDisplayChanged** - event notifications about the visibility of the filmstrip being updated.
218
+```javascript
219
+{
220
+"visible": visible, // Whether or not the filmstrip is displayed or hidden.
221
+}
222
+```
217 223
 
218 224
 * **participantJoined** - event notifications about new participants who join the room. The listener will receive an object with the following structure:
219 225
 ```javascript

+ 15
- 0
modules/API/API.js Visa fil

@@ -551,6 +551,21 @@ class API {
551 551
         this._sendEvent({ name: 'feedback-prompt-displayed' });
552 552
     }
553 553
 
554
+    /**
555
+     * Notify external application (if API is enabled) that the display
556
+     * configuration of the filmstrip has been changed.
557
+     *
558
+     * @param {boolean} visible - Whether or not the filmstrip has been set to
559
+     * be displayed or hidden.
560
+     * @returns {void}
561
+     */
562
+    notifyFilmstripDisplayChanged(visible: boolean) {
563
+        this._sendEvent({
564
+            name: 'filmstrip-display-changed',
565
+            visible
566
+        });
567
+    }
568
+
554 569
     /**
555 570
      * Notify external application (if API is enabled) that the screen sharing
556 571
      * has been turned on/off.

+ 1
- 0
modules/API/external/external_api.js Visa fil

@@ -44,6 +44,7 @@ const events = {
44 44
     'email-change': 'emailChange',
45 45
     'feedback-submitted': 'feedbackSubmitted',
46 46
     'feedback-prompt-displayed': 'feedbackPromptDisplayed',
47
+    'filmstrip-display-changed': 'filmstripDisplayChanged',
47 48
     'incoming-message': 'incomingMessage',
48 49
     'outgoing-message': 'outgoingMessage',
49 50
     'participant-joined': 'participantJoined',

+ 1
- 0
react/features/video-layout/middleware.web.js Visa fil

@@ -82,6 +82,7 @@ MiddlewareRegistry.register(store => next => action => {
82 82
     case SET_FILMSTRIP_VISIBLE:
83 83
         VideoLayout.resizeVideoArea(true, false);
84 84
         APP.UI.emitEvent(UIEvents.TOGGLED_FILMSTRIP, action.visible);
85
+        APP.API.notifyFilmstripDisplayChanged(action.visible);
85 86
         break;
86 87
 
87 88
     case SET_TILE_VIEW:

Laddar…
Avbryt
Spara