浏览代码

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

j8
Jaya Allamsetty 5 年前
父节点
当前提交
b6792db65f
共有 3 个文件被更改,包括 16 次插入7 次删除
  1. 7
    2
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js
  3. 8
    5
      react/features/large-video/actions.js

+ 7
- 2
modules/API/API.js 查看文件

21
 import { isEnabled as isDropboxEnabled } from '../../react/features/dropbox';
21
 import { isEnabled as isDropboxEnabled } from '../../react/features/dropbox';
22
 import { toggleE2EE } from '../../react/features/e2ee/actions';
22
 import { toggleE2EE } from '../../react/features/e2ee/actions';
23
 import { invite } from '../../react/features/invite';
23
 import { invite } from '../../react/features/invite';
24
+import { selectParticipantInLargeVideo } from '../../react/features/large-video/actions';
24
 import { toggleLobbyMode } from '../../react/features/lobby/actions.web';
25
 import { toggleLobbyMode } from '../../react/features/lobby/actions.web';
25
 import { RECORDING_TYPES } from '../../react/features/recording/constants';
26
 import { RECORDING_TYPES } from '../../react/features/recording/constants';
26
 import { getActiveSession } from '../../react/features/recording/functions';
27
 import { getActiveSession } from '../../react/features/recording/functions';
123
 
124
 
124
             APP.store.dispatch(sendTones(tones, duration, pause));
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
         'subject': subject => {
132
         'subject': subject => {
127
             sendAnalytics(createApiEvent('subject.changed'));
133
             sendAnalytics(createApiEvent('subject.changed'));
128
             APP.store.dispatch(setSubject(subject));
134
             APP.store.dispatch(setSubject(subject));
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
      * @param {string} roomName - User id.
721
      * @param {string} roomName - User id.
717
      * @returns {void}
722
      * @returns {void}

+ 1
- 0
modules/API/external/external_api.js 查看文件

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

+ 8
- 5
react/features/large-video/actions.js 查看文件

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
  * @returns {Function}
59
  * @returns {Function}
57
  */
60
  */
58
-export function selectParticipantInLargeVideo() {
61
+export function selectParticipantInLargeVideo(participant: ?string) {
59
     return (dispatch: Dispatch<any>, getState: Function) => {
62
     return (dispatch: Dispatch<any>, getState: Function) => {
60
         const state = getState();
63
         const state = getState();
61
-        const participantId = _electParticipantInLargeVideo(state);
64
+        const participantId = participant ?? _electParticipantInLargeVideo(state);
62
         const largeVideo = state['features/large-video'];
65
         const largeVideo = state['features/large-video'];
63
 
66
 
64
         if (participantId !== largeVideo.participantId) {
67
         if (participantId !== largeVideo.participantId) {

正在加载...
取消
保存