feat(external_api) allow initial gUM requests to be disabled

This commit is contained in:
Tudor-Ovidiu Avram 2021-01-11 13:16:49 +02:00 committed by Дамян Минков
parent 0a5910f0b3
commit 4cb7ebce70
3 changed files with 17 additions and 9 deletions

View File

@ -472,8 +472,8 @@ export default {
*/
createInitialLocalTracks(options = {}) {
const errors = {};
const initialDevices = [ 'audio' ];
const requestedAudio = true;
const initialDevices = config.disableInitialGUM ? [] : [ 'audio' ];
const requestedAudio = !config.disableInitialGUM;
let requestedVideo = false;
// Always get a handle on the audio input device so that we have statistics even if the user joins the
@ -484,19 +484,22 @@ export default {
this.muteAudio(true, true);
}
if (!options.startWithVideoMuted
if (!config.disableInitialGUM
&& !options.startWithVideoMuted
&& !options.startAudioOnly
&& !options.startScreenSharing) {
initialDevices.push('video');
requestedVideo = true;
}
JitsiMeetJS.mediaDevices.addEventListener(
JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
browserName =>
APP.store.dispatch(
mediaPermissionPromptVisibilityChanged(true, browserName))
);
if (!config.disableInitialGUM) {
JitsiMeetJS.mediaDevices.addEventListener(
JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
browserName =>
APP.store.dispatch(
mediaPermissionPromptVisibilityChanged(true, browserName))
);
}
let tryCreateLocalTracks;

View File

@ -336,6 +336,10 @@ var config = {
// will be joined when no room is specified.
enableWelcomePage: true,
// Disable initial browser getUserMedia requests.
// This is useful for scenarios where users might want to start a conference for screensharing only
// disableInitialGUM: false,
// Enabling the close page will ignore the welcome page redirection when
// a call is hangup.
// enableClosePage: false,

View File

@ -80,6 +80,7 @@ export default [
'disableAP',
'disableAudioLevels',
'disableDeepLinking',
'disableInitialGUM',
'disableH264',
'disableHPF',
'disableInviteFunctions',