Explorar el Código

feat(external_api): Add command for toggling localFlipX

j8
Mihai-Andrei Uscat hace 4 años
padre
commit
a78ca5fcad
No account linked to committer's email address
Se han modificado 2 ficheros con 8 adiciones y 0 borrados
  1. 7
    0
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js

+ 7
- 0
modules/API/API.js Ver fichero

@@ -23,6 +23,7 @@ import {
23 23
     pinParticipant,
24 24
     kickParticipant
25 25
 } from '../../react/features/base/participants';
26
+import { updateSettings } from '../../react/features/base/settings';
26 27
 import { isToggleCameraEnabled, toggleCamera } from '../../react/features/base/tracks';
27 28
 import { setPrivateMessageRecipient } from '../../react/features/chat/actions';
28 29
 import { openChat } from '../../react/features/chat/actions.web';
@@ -177,6 +178,12 @@ function initCommands() {
177 178
 
178 179
             APP.store.dispatch(toggleCamera());
179 180
         },
181
+        'toggle-camera-mirror': () => {
182
+            const state = APP.store.getState();
183
+            const { localFlipX: currentFlipX } = state['features/base/settings'];
184
+
185
+            APP.store.dispatch(updateSettings({ localFlipX: !currentFlipX }));
186
+        },
180 187
         'toggle-chat': () => {
181 188
             sendAnalytics(createApiEvent('chat.toggled'));
182 189
             APP.UI.toggleChat();

+ 1
- 0
modules/API/external/external_api.js Ver fichero

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

Loading…
Cancelar
Guardar