浏览代码

feat(external-api) add commands to open/close the participants pane

master
Mihaela Dumitru 3 年前
父节点
当前提交
2e8a635373
共有 2 个文件被更改,包括 28 次插入1 次删除
  1. 15
    1
      modules/API/API.js
  2. 13
    0
      modules/API/external/external_api.js

+ 15
- 1
modules/API/API.js 查看文件

@@ -73,7 +73,11 @@ import {
73 73
     resizeLargeVideo
74 74
 } from '../../react/features/large-video/actions.web';
75 75
 import { toggleLobbyMode, setKnockingParticipantApproval } from '../../react/features/lobby/actions';
76
-import { isForceMuted } from '../../react/features/participants-pane/functions';
76
+import {
77
+    close as closeParticipantsPane,
78
+    open as openParticipantsPane
79
+} from '../../react/features/participants-pane/actions';
80
+import { getParticipantsPaneOpen, isForceMuted } from '../../react/features/participants-pane/functions';
77 81
 import { RECORDING_TYPES } from '../../react/features/recording/constants';
78 82
 import { getActiveSession } from '../../react/features/recording/functions';
79 83
 import { isScreenAudioSupported } from '../../react/features/screen-share';
@@ -317,6 +321,12 @@ function initCommands() {
317 321
                 APP.store.dispatch(disable());
318 322
             }
319 323
         },
324
+        'toggle-participants-pane': enabled => {
325
+            const toggleParticipantsPane = enabled
326
+                ? openParticipantsPane : closeParticipantsPane;
327
+
328
+            APP.store.dispatch(toggleParticipantsPane());
329
+        },
320 330
         'toggle-raise-hand': () => {
321 331
             const localParticipant = getLocalParticipant(APP.store.getState());
322 332
 
@@ -690,6 +700,10 @@ function initCommands() {
690 700
             callback(isForceMuted(participant, type, state));
691 701
             break;
692 702
         }
703
+        case 'is-participants-pane-open': {
704
+            callback(getParticipantsPaneOpen(APP.store.getState()));
705
+            break;
706
+        }
693 707
         case 'is-video-muted':
694 708
             callback(APP.conference.isLocalVideoMuted());
695 709
             break;

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

@@ -74,6 +74,7 @@ const commands = {
74 74
     toggleE2EE: 'toggle-e2ee',
75 75
     toggleFilmStrip: 'toggle-film-strip',
76 76
     toggleModeration: 'toggle-moderation',
77
+    toggleParticipantsPane: 'toggle-participants-pane',
77 78
     toggleRaiseHand: 'toggle-raise-hand',
78 79
     toggleShareAudio: 'toggle-share-audio',
79 80
     toggleShareScreen: 'toggle-share-screen',
@@ -946,6 +947,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
946 947
         });
947 948
     }
948 949
 
950
+    /**
951
+     * Returns whether the participants pane is open.
952
+     *
953
+     * @returns {Promise} - Resolves with true if the participants pane is open
954
+     * and with false if not.
955
+     */
956
+    isParticipantsPaneOpen() {
957
+        return this._transport.sendRequest({
958
+            name: 'is-participants-pane-open'
959
+        });
960
+    }
961
+
949 962
     /**
950 963
      * Returns screen sharing status.
951 964
      *

正在加载...
取消
保存