feat(external_api): Add command for toggling camera on mobile web

This commit is contained in:
Mihai-Andrei Uscat
2021-03-25 13:48:49 +02:00
committed by GitHub
parent 2c9078985f
commit 1ad40de487
4 changed files with 26 additions and 4 deletions

View File

@@ -23,6 +23,7 @@ import {
pinParticipant,
kickParticipant
} from '../../react/features/base/participants';
import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks';
import { setPrivateMessageRecipient } from '../../react/features/chat/actions';
import { openChat } from '../../react/features/chat/actions.web';
import {
@@ -169,6 +170,13 @@ function initCommands() {
sendAnalytics(createApiEvent('film.strip.toggled'));
APP.UI.toggleFilmstrip();
},
'toggle-camera': () => {
if (!isToggleCameraEnabled(APP.store.getState())) {
return;
}
APP.store.dispatch(toggleCamera());
},
'toggle-chat': () => {
sendAnalytics(createApiEvent('chat.toggled'));
APP.UI.toggleChat();