Browse Source

feat(external_api) allow initial gUM requests to be disabled

master
Tudor-Ovidiu Avram 4 years ago
parent
commit
4cb7ebce70
3 changed files with 17 additions and 9 deletions
  1. 12
    9
      conference.js
  2. 4
    0
      config.js
  3. 1
    0
      react/features/base/config/configWhitelist.js

+ 12
- 9
conference.js View File

472
      */
472
      */
473
     createInitialLocalTracks(options = {}) {
473
     createInitialLocalTracks(options = {}) {
474
         const errors = {};
474
         const errors = {};
475
-        const initialDevices = [ 'audio' ];
476
-        const requestedAudio = true;
475
+        const initialDevices = config.disableInitialGUM ? [] : [ 'audio' ];
476
+        const requestedAudio = !config.disableInitialGUM;
477
         let requestedVideo = false;
477
         let requestedVideo = false;
478
 
478
 
479
         // Always get a handle on the audio input device so that we have statistics even if the user joins the
479
         // Always get a handle on the audio input device so that we have statistics even if the user joins the
484
             this.muteAudio(true, true);
484
             this.muteAudio(true, true);
485
         }
485
         }
486
 
486
 
487
-        if (!options.startWithVideoMuted
487
+        if (!config.disableInitialGUM
488
+                && !options.startWithVideoMuted
488
                 && !options.startAudioOnly
489
                 && !options.startAudioOnly
489
                 && !options.startScreenSharing) {
490
                 && !options.startScreenSharing) {
490
             initialDevices.push('video');
491
             initialDevices.push('video');
491
             requestedVideo = true;
492
             requestedVideo = true;
492
         }
493
         }
493
 
494
 
494
-        JitsiMeetJS.mediaDevices.addEventListener(
495
-            JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
496
-            browserName =>
497
-                APP.store.dispatch(
498
-                    mediaPermissionPromptVisibilityChanged(true, browserName))
499
-        );
495
+        if (!config.disableInitialGUM) {
496
+            JitsiMeetJS.mediaDevices.addEventListener(
497
+                JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
498
+                browserName =>
499
+                    APP.store.dispatch(
500
+                        mediaPermissionPromptVisibilityChanged(true, browserName))
501
+            );
502
+        }
500
 
503
 
501
         let tryCreateLocalTracks;
504
         let tryCreateLocalTracks;
502
 
505
 

+ 4
- 0
config.js View File

336
     // will be joined when no room is specified.
336
     // will be joined when no room is specified.
337
     enableWelcomePage: true,
337
     enableWelcomePage: true,
338
 
338
 
339
+    // Disable initial browser getUserMedia requests.
340
+    // This is useful for scenarios where users might want to start a conference for screensharing only
341
+    // disableInitialGUM: false,
342
+
339
     // Enabling the close page will ignore the welcome page redirection when
343
     // Enabling the close page will ignore the welcome page redirection when
340
     // a call is hangup.
344
     // a call is hangup.
341
     // enableClosePage: false,
345
     // enableClosePage: false,

+ 1
- 0
react/features/base/config/configWhitelist.js View File

80
     'disableAP',
80
     'disableAP',
81
     'disableAudioLevels',
81
     'disableAudioLevels',
82
     'disableDeepLinking',
82
     'disableDeepLinking',
83
+    'disableInitialGUM',
83
     'disableH264',
84
     'disableH264',
84
     'disableHPF',
85
     'disableHPF',
85
     'disableInviteFunctions',
86
     'disableInviteFunctions',

Loading…
Cancel
Save