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

This commit is contained in:
Mihaela Dumitru 2022-02-01 12:45:54 +02:00 committed by Horatiu Muresan
parent 01ab415941
commit 2e8a635373
2 changed files with 28 additions and 1 deletions

View File

@ -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;

View File

@ -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.
*