Browse Source

feat(external_api): Add cmd for selecting a user to be displayed in large video

j8
Jaya Allamsetty 5 years ago
parent
commit
b6792db65f

+ 7
- 2
modules/API/API.js View File

@@ -21,6 +21,7 @@ import {
21 21
 import { isEnabled as isDropboxEnabled } from '../../react/features/dropbox';
22 22
 import { toggleE2EE } from '../../react/features/e2ee/actions';
23 23
 import { invite } from '../../react/features/invite';
24
+import { selectParticipantInLargeVideo } from '../../react/features/large-video/actions';
24 25
 import { toggleLobbyMode } from '../../react/features/lobby/actions.web';
25 26
 import { RECORDING_TYPES } from '../../react/features/recording/constants';
26 27
 import { getActiveSession } from '../../react/features/recording/functions';
@@ -123,6 +124,11 @@ function initCommands() {
123 124
 
124 125
             APP.store.dispatch(sendTones(tones, duration, pause));
125 126
         },
127
+        'set-large-video-participant': participantId => {
128
+            logger.debug('Set large video participant command received');
129
+            sendAnalytics(createApiEvent('largevideo.participant.changed'));
130
+            APP.store.dispatch(selectParticipantInLargeVideo(participantId));
131
+        },
126 132
         'subject': subject => {
127 133
             sendAnalytics(createApiEvent('subject.changed'));
128 134
             APP.store.dispatch(setSubject(subject));
@@ -710,8 +716,7 @@ class API {
710 716
     }
711 717
 
712 718
     /**
713
-     * Notify external application (if API is enabled) that user changed their
714
-     * nickname.
719
+     * Notify external application (if API is enabled) that local user has left the conference.
715 720
      *
716 721
      * @param {string} roomName - User id.
717 722
      * @returns {void}

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

@@ -37,6 +37,7 @@ const commands = {
37 37
     password: 'password',
38 38
     sendEndpointTextMessage: 'send-endpoint-text-message',
39 39
     sendTones: 'send-tones',
40
+    setLargeVideoParticipant: 'set-large-video-participant',
40 41
     setVideoQuality: 'set-video-quality',
41 42
     startRecording: 'start-recording',
42 43
     stopRecording: 'stop-recording',

+ 8
- 5
react/features/large-video/actions.js View File

@@ -49,16 +49,19 @@ export function selectParticipant() {
49 49
 }
50 50
 
51 51
 /**
52
- * Action to select the participant to be displayed in LargeVideo based on a
53
- * variety of factors: If there is a dominant or pinned speaker, or if there are
54
- * remote tracks, etc.
52
+ * Action to select the participant to be displayed in LargeVideo based on the
53
+ * participant id provided. If a partcipant id is not provided, the LargeVideo
54
+ * participant will be selected based on a variety of factors: If there is a
55
+ * dominant or pinned speaker, or if there are remote tracks, etc.
55 56
  *
57
+ * @param {string} participant - The participant id of the user that needs to be
58
+ * displayed on the large video.
56 59
  * @returns {Function}
57 60
  */
58
-export function selectParticipantInLargeVideo() {
61
+export function selectParticipantInLargeVideo(participant: ?string) {
59 62
     return (dispatch: Dispatch<any>, getState: Function) => {
60 63
         const state = getState();
61
-        const participantId = _electParticipantInLargeVideo(state);
64
+        const participantId = participant ?? _electParticipantInLargeVideo(state);
62 65
         const largeVideo = state['features/large-video'];
63 66
 
64 67
         if (participantId !== largeVideo.participantId) {

Loading…
Cancel
Save