Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Mihaela Dumitru2e8a635373dc
diff --git a/modules/API/API.js b/modules/API/API.js
index 2d2ebd7ed6..d7669cf4a9 100644
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -73,7 +73,11 @@ import {
resizeLargeVideo
} from '../../react/features/large-video/actions.web';
import { toggleLobbyMode, setKnockingParticipantApproval } from '../../react/features/lobby/actions';
-import { isForceMuted } from '../../react/features/participants-pane/functions';
+import {
+ close as closeParticipantsPane,
+ open as openParticipantsPane
+} from '../../react/features/participants-pane/actions';
+import { getParticipantsPaneOpen, isForceMuted } from '../../react/features/participants-pane/functions';
import { RECORDING_TYPES } from '../../react/features/recording/constants';
import { getActiveSession } from '../../react/features/recording/functions';
import { isScreenAudioSupported } from '../../react/features/screen-share';
@@ -317,6 +321,12 @@ function initCommands() {
APP.store.dispatch(disable());
}
},
+ 'toggle-participants-pane': enabled => {
+ const toggleParticipantsPane = enabled
+ ? openParticipantsPane : closeParticipantsPane;
+
+ APP.store.dispatch(toggleParticipantsPane());
+ },
'toggle-raise-hand': () => {
const localParticipant = getLocalParticipant(APP.store.getState());
@@ -690,6 +700,10 @@ function initCommands() {
callback(isForceMuted(participant, type, state));
break;
}
+ case 'is-participants-pane-open': {
+ callback(getParticipantsPaneOpen(APP.store.getState()));
+ break;
+ }
case 'is-video-muted':
callback(APP.conference.isLocalVideoMuted());
break;
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 4714dafd17..46a62368d7 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -74,6 +74,7 @@ const commands = {
toggleE2EE: 'toggle-e2ee',
toggleFilmStrip: 'toggle-film-strip',
toggleModeration: 'toggle-moderation',
+ toggleParticipantsPane: 'toggle-participants-pane',
toggleRaiseHand: 'toggle-raise-hand',
toggleShareAudio: 'toggle-share-audio',
toggleShareScreen: 'toggle-share-screen',
@@ -946,6 +947,18 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
});
}
+ /**
+ * Returns whether the participants pane is open.
+ *
+ * @returns {Promise} - Resolves with true if the participants pane is open
+ * and with false if not.
+ */
+ isParticipantsPaneOpen() {
+ return this._transport.sendRequest({
+ name: 'is-participants-pane-open'
+ });
+ }
+
/**
* Returns screen sharing status.
*