diff --git a/config.js b/config.js index 1c3f934be9..d1d8fdb71e 100644 --- a/config.js +++ b/config.js @@ -401,6 +401,8 @@ var config = { // // If true, mutes audio and video when a recording begins and displays a dialog // // explaining the effect of unmuting. // // requireConsent: true, + // // If true consent will be skipped for users who are already in the meeting. + // // skipConsentInMeeting: true, // }, // recordingService: { diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts index de9cc43d57..57024ba99f 100644 --- a/react/features/base/config/configType.ts +++ b/react/features/base/config/configType.ts @@ -546,6 +546,7 @@ export interface IConfig { requireConsent?: boolean; showPrejoinWarning?: boolean; showRecordingLink?: boolean; + skipConsentInMeeting?: boolean; suggestRecording?: boolean; }; remoteVideoMenu?: { diff --git a/react/features/dynamic-branding/reducer.ts b/react/features/dynamic-branding/reducer.ts index 6f76ccd9d4..655aeb7547 100644 --- a/react/features/dynamic-branding/reducer.ts +++ b/react/features/dynamic-branding/reducer.ts @@ -180,6 +180,7 @@ export interface IDynamicBrandingState { requireRecordingConsent?: boolean; sharedVideoAllowedURLDomains?: Array; showGiphyIntegration?: boolean; + skipRecordingConsentInMeeting?: boolean; supportUrl?: string; useDynamicBrandingData: boolean; virtualBackgrounds: Array; @@ -206,9 +207,10 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STA muiBrandedTheme, pollCreationRequiresPermission, premeetingBackground, + requireRecordingConsent, sharedVideoAllowedURLDomains, showGiphyIntegration, - requireRecordingConsent, + skipRecordingConsentInMeeting, supportUrl, virtualBackgrounds } = action.value; @@ -228,9 +230,10 @@ ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STA muiBrandedTheme, pollCreationRequiresPermission, premeetingBackground, + requireRecordingConsent, sharedVideoAllowedURLDomains, showGiphyIntegration, - requireRecordingConsent, + skipRecordingConsentInMeeting, supportUrl, customizationFailed: false, customizationReady: true, diff --git a/react/features/recording/functions.ts b/react/features/recording/functions.ts index b5251d8a97..eab7d2027c 100644 --- a/react/features/recording/functions.ts +++ b/react/features/recording/functions.ts @@ -439,8 +439,10 @@ export function isLiveStreamingButtonVisible({ * @returns {boolean} */ export function shouldRequireRecordingConsent(recorderSession: any, state: IReduxState) { - const { requireRecordingConsent } = state['features/dynamic-branding'] || {}; - const { requireConsent } = state['features/base/config'].recordings || {}; + const { requireRecordingConsent, skipRecordingConsentInMeeting } + = state['features/dynamic-branding'] || {}; + const { conference } = state['features/base/conference'] || {}; + const { requireConsent, skipConsentInMeeting } = state['features/base/config'].recordings || {}; const { iAmRecorder } = state['features/base/config']; const { consentRequested } = state['features/recording']; @@ -460,6 +462,13 @@ export function shouldRequireRecordingConsent(recorderSession: any, state: IRedu return false; } + // If we join a meeting that has an ongoing recording `conference` will be undefined since + // we get the recording state through the initial presence which happens in between the + // WILL_JOIN and JOINED events. + if (conference && (skipConsentInMeeting || skipRecordingConsentInMeeting)) { + return false; + } + const initiator = recorderSession.getInitiator(); if (!initiator || recorderSession.getStatus() === JitsiRecordingConstants.status.OFF) {