From 9855fac8059091c9863c5075cf1fd057dea33ded Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Wed, 5 Feb 2020 16:18:53 -0500 Subject: [PATCH] fix(screenshot-capture): Move the flag for enabling/disabling the feature to config.js This will let us enable/disable the feature based on environment/deployment --- conference.js | 9 ++++++--- interface_config.js | 5 ----- react/features/base/config/configWhitelist.js | 1 + .../screenshot-capture/ScreenshotCaptureEffect.js | 6 +----- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/conference.js b/conference.js index 9244f2e42..f329dedd5 100644 --- a/conference.js +++ b/conference.js @@ -1460,8 +1460,9 @@ export default { } else { promise = promise.then(() => this.useVideoStream(null)); } - - APP.store.dispatch(toggleScreenshotCaptureEffect(false)); + if (config.enableScreenshotCapture) { + APP.store.dispatch(toggleScreenshotCaptureEffect(false)); + } return promise.then( () => { @@ -1734,7 +1735,9 @@ export default { .then(stream => this.useVideoStream(stream)) .then(() => { this.videoSwitchInProgress = false; - APP.store.dispatch(toggleScreenshotCaptureEffect(true)); + if (config.enableScreenshotCapture) { + APP.store.dispatch(toggleScreenshotCaptureEffect(true)); + } sendAnalytics(createScreenSharingEvent('started')); logger.log('Screen sharing started'); }) diff --git a/interface_config.js b/interface_config.js index e220ae13a..4da482840 100644 --- a/interface_config.js +++ b/interface_config.js @@ -190,11 +190,6 @@ var interfaceConfig = { */ AUTO_PIN_LATEST_SCREEN_SHARE: 'remote-only', - /** - * If we should capture periodic screenshots of the content sharing. - */ - ENABLE_SCREENSHOT_CAPTURE: false, - /** * If true, presence status: busy, calling, connected etc. is not displayed. */ diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index cb4677a7b..791f26d12 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -96,6 +96,7 @@ export default [ 'enableLayerSuspension', 'enableLipSync', 'enableRemb', + 'enableScreenshotCapture', 'enableTalkWhileMuted', 'enableNoAudioDetection', 'enableNoisyMicDetection', diff --git a/react/features/stream-effects/screenshot-capture/ScreenshotCaptureEffect.js b/react/features/stream-effects/screenshot-capture/ScreenshotCaptureEffect.js index 24fd3bfbd..b940ab6fe 100644 --- a/react/features/stream-effects/screenshot-capture/ScreenshotCaptureEffect.js +++ b/react/features/stream-effects/screenshot-capture/ScreenshotCaptureEffect.js @@ -57,11 +57,7 @@ export default class ScreenshotCaptureEffect { * @returns {boolean} - Returns true if this effect can run on the specified track, false otherwise. */ isEnabled(jitsiLocalTrack: Object) { - return ( - interfaceConfig.ENABLE_SCREENSHOT_CAPTURE - && jitsiLocalTrack.isVideoTrack() - && jitsiLocalTrack.videoType === 'desktop' - ); + return jitsiLocalTrack.isVideoTrack() && jitsiLocalTrack.videoType === 'desktop'; } /**