feat(external_api): Add command for toggling localFlipX

This commit is contained in:
Mihai-Andrei Uscat 2021-03-25 14:57:41 +02:00 committed by GitHub
parent 1ad40de487
commit a78ca5fcad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import {
pinParticipant,
kickParticipant
} from '../../react/features/base/participants';
import { updateSettings } from '../../react/features/base/settings';
import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks';
import { setPrivateMessageRecipient } from '../../react/features/chat/actions';
import { openChat } from '../../react/features/chat/actions.web';
@ -177,6 +178,12 @@ function initCommands() {
APP.store.dispatch(toggleCamera());
},
'toggle-camera-mirror': () => {
const state = APP.store.getState();
const { localFlipX: currentFlipX } = state['features/base/settings'];
APP.store.dispatch(updateSettings({ localFlipX: !currentFlipX }));
},
'toggle-chat': () => {
sendAnalytics(createApiEvent('chat.toggled'));
APP.UI.toggleChat();

View File

@ -52,6 +52,7 @@ const commands = {
submitFeedback: 'submit-feedback',
toggleAudio: 'toggle-audio',
toggleCamera: 'toggle-camera',
toggleCameraMirror: 'toggle-camera-mirror',
toggleChat: 'toggle-chat',
toggleFilmStrip: 'toggle-film-strip',
toggleRaiseHand: 'toggle-raise-hand',