feat(external-api) Add endConference command

This commit is contained in:
Shawn 2022-09-16 13:29:54 +01:00 committed by Saúl Ibarra Corretgé
parent cdb2436b73
commit 17cace070e
2 changed files with 15 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import {
} from '../../react/features/av-moderation/actions';
import { isEnabledFromState } from '../../react/features/av-moderation/functions';
import {
endConference,
getCurrentConference,
sendTones,
setFollowMe,
@ -777,6 +778,19 @@ function initCommands() {
},
'toggle-virtual-background': () => {
APP.store.dispatch(toggleDialog(VirtualBackgroundDialog));
},
'end-conference': () => {
APP.store.dispatch(endConference());
const state = APP.store.getState();
const conference = getCurrentConference(state);
if (!conference) {
logger.error('Conference not yet available');
} else if (conference.isEndConferenceSupported()) {
APP.store.dispatch(endConference());
} else {
logger.error(' End Conference not supported');
}
}
};
transport.on('event', ({ data, name }) => {

View File

@ -37,6 +37,7 @@ const commands = {
closeBreakoutRoom: 'close-breakout-room',
displayName: 'display-name',
e2eeKey: 'e2ee-key',
endConference: 'end-conference',
email: 'email',
grantModerator: 'grant-moderator',
hangup: 'video-hangup',