feat(external-api): add toggle subtitles command (#10070)

* feat(external-api): add toggle subtitles command

* feat(external-api): add set subtitles command
This commit is contained in:
Gabriel Borlea
2022-04-20 11:43:18 +03:00
committed by GitHub
parent aa944e76ad
commit dde8c586da
6 changed files with 67 additions and 2 deletions

View File

@@ -87,6 +87,7 @@ import { toggleScreenshotCaptureSummary } from '../../react/features/screenshot-
import { isScreenshotCaptureEnabled } from '../../react/features/screenshot-capture/functions';
import { playSharedVideo, stopSharedVideo } from '../../react/features/shared-video/actions.any';
import { extractYoutubeIdOrURL } from '../../react/features/shared-video/functions';
import { toggleRequestingSubtitles, setRequestingSubtitles } from '../../react/features/subtitles/actions';
import { toggleTileView, setTileView } from '../../react/features/video-layout';
import { muteAllParticipants } from '../../react/features/video-menu/actions';
import { setVideoQuality } from '../../react/features/video-quality';
@@ -371,6 +372,12 @@ function initCommands() {
sendAnalytics(createApiEvent('screen.sharing.toggled'));
toggleScreenSharing(options.enable);
},
'toggle-subtitles': () => {
APP.store.dispatch(toggleRequestingSubtitles());
},
'set-subtitles': enabled => {
APP.store.dispatch(setRequestingSubtitles(enabled));
},
'toggle-tile-view': () => {
sendAnalytics(createApiEvent('tile-view.toggled'));