Sfoglia il codice sorgente

external-api: add muteEveryone command

master
Alejandro Blanco 5 anni fa
parent
commit
2e2d40c1d0
Nessun account collegato all'indirizzo email del committer
2 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  1. 11
    1
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js

+ 11
- 1
modules/API/API.js Vedi File

@@ -16,7 +16,7 @@ import { invite } from '../../react/features/invite';
16 16
 import { toggleTileView } from '../../react/features/video-layout';
17 17
 import { setVideoQuality } from '../../react/features/video-quality';
18 18
 import { getJitsiMeetTransport } from '../transport';
19
-
19
+import { muteAllParticipants } from '../../react/features/remote-video-menu/actions';
20 20
 import { API_ID, ENDPOINT_TEXT_MESSAGE_NAME } from './constants';
21 21
 import {
22 22
     processExternalDeviceRequest
@@ -71,6 +71,16 @@ function initCommands() {
71 71
             sendAnalytics(createApiEvent('display.name.changed'));
72 72
             APP.conference.changeLocalDisplayName(displayName);
73 73
         },
74
+        'mute-everyone': () => {
75
+            sendAnalytics(createApiEvent('muted-everyone'));
76
+            const participants = APP.store.getState()['features/base/participants'];
77
+            const localIds = participants
78
+                .filter(participant => participant.local)
79
+                .filter(participant => participant.role === 'moderator')
80
+                .map(participant => participant.id);
81
+
82
+            APP.store.dispatch(muteAllParticipants(localIds));
83
+        },
74 84
         'password': password => {
75 85
             const { conference, passwordRequired }
76 86
                 = APP.store.getState()['features/base/conference'];

+ 1
- 0
modules/API/external/external_api.js Vedi File

@@ -32,6 +32,7 @@ const commands = {
32 32
     e2eeKey: 'e2ee-key',
33 33
     email: 'email',
34 34
     hangup: 'video-hangup',
35
+    muteEveryone: 'mute-everyone',
35 36
     password: 'password',
36 37
     sendEndpointTextMessage: 'send-endpoint-text-message',
37 38
     sendTones: 'send-tones',

Loading…
Annulla
Salva