Quellcode durchsuchen

feat(external-api) support assumed bandwidth bps config and command (#13164)

factor2
Mihaela Dumitru vor 2 Jahren
Ursprung
Commit
9f39caa247
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 22
- 1
modules/API/API.js Datei anzeigen

@@ -115,7 +115,11 @@ import { muteAllParticipants } from '../../react/features/video-menu/actions';
115 115
 import { setVideoQuality } from '../../react/features/video-quality/actions';
116 116
 import { getJitsiMeetTransport } from '../transport';
117 117
 
118
-import { API_ID, ENDPOINT_TEXT_MESSAGE_NAME } from './constants';
118
+import {
119
+    API_ID,
120
+    ASSUMED_BANDWIDTH_BPS,
121
+    ENDPOINT_TEXT_MESSAGE_NAME
122
+} from './constants';
119 123
 
120 124
 const logger = Logger.getLogger(__filename);
121 125
 
@@ -310,6 +314,23 @@ function initCommands() {
310 314
 
311 315
             APP.store.dispatch(sendTones(tones, duration, pause));
312 316
         },
317
+        'set-assumed-bandwidth-bps': value => {
318
+            logger.debug('Set assumed bandwidth bps command received', value);
319
+
320
+            if (typeof value !== 'number' || isNaN(value)) {
321
+                logger.error('Assumed bandwidth bps must be a number.');
322
+
323
+                return;
324
+            }
325
+
326
+            const { conference } = APP.store.getState()['features/base/conference'];
327
+
328
+            if (conference) {
329
+                conference.setAssumedBandwidthBps(value < ASSUMED_BANDWIDTH_BPS
330
+                    ? ASSUMED_BANDWIDTH_BPS
331
+                    : value);
332
+            }
333
+        },
313 334
         'set-follow-me': value => {
314 335
             logger.debug('Set follow me command received');
315 336
 

+ 7
- 0
modules/API/constants.js Datei anzeigen

@@ -15,3 +15,10 @@ export const API_ID = parseURLParams(window.location).jitsi_meet_external_api_id
15 15
  * The payload name for the datachannel/endpoint text message event.
16 16
  */
17 17
 export const ENDPOINT_TEXT_MESSAGE_NAME = 'endpoint-text-message';
18
+
19
+/**
20
+ * The min value that can be set for the assumed bandwidth.
21
+ * Setting it to this value means not assuming any bandwidth,
22
+ * but rather allowing the estimations to take place.
23
+ */
24
+export const ASSUMED_BANDWIDTH_BPS = -1;

+ 1
- 0
modules/API/external/external_api.js Datei anzeigen

@@ -59,6 +59,7 @@ const commands = {
59 59
     sendEndpointTextMessage: 'send-endpoint-text-message',
60 60
     sendParticipantToRoom: 'send-participant-to-room',
61 61
     sendTones: 'send-tones',
62
+    setAssumedBandwidthBps: 'set-assumed-bandwidth-bps',
62 63
     setFollowMe: 'set-follow-me',
63 64
     setLargeVideoParticipant: 'set-large-video-participant',
64 65
     setMediaEncryptionKey: 'set-media-encryption-key',

+ 1
- 0
react/features/base/conference/reducer.ts Datei anzeigen

@@ -104,6 +104,7 @@ export interface IJitsiConference {
104 104
     sendTextMessage: Function;
105 105
     sendTones: Function;
106 106
     sessionId: string;
107
+    setAssumedBandwidthBps: (value: number) => void;
107 108
     setDesktopSharingFrameRate: Function;
108 109
     setDisplayName: Function;
109 110
     setLocalParticipantProperty: Function;

Laden…
Abbrechen
Speichern