From 76f7f3943fbc569c402921d4f4b96ccb8c45835d Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Wed, 6 Jul 2022 15:47:06 -0400 Subject: [PATCH] fix(virtual-background) Do not allow desktop as virtual background when multi-stream is enabled. --- .../components/VirtualBackgroundDialog.js | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/react/features/virtual-background/components/VirtualBackgroundDialog.js b/react/features/virtual-background/components/VirtualBackgroundDialog.js index 577211dcd..f0dd8be1d 100644 --- a/react/features/virtual-background/components/VirtualBackgroundDialog.js +++ b/react/features/virtual-background/components/VirtualBackgroundDialog.js @@ -8,6 +8,7 @@ import clsx from 'clsx'; import React, { useState, useEffect, useCallback } from 'react'; import { useSelector } from 'react-redux'; +import { getMultipleVideoSendingSupportFeatureFlag } from '../../base/config'; import { Dialog, hideDialog, openDialog } from '../../base/dialog'; import { translate } from '../../base/i18n'; import { Icon, IconCloseSmall, IconShareDesktop } from '../../base/icons'; @@ -34,15 +35,20 @@ type Props = { */ _images: Array, + /** + * Returns the jitsi track that will have backgraund effect applied. + */ + _jitsiTrack: Object, + /** * The current local flip x status. */ _localFlipX: boolean, /** - * Returns the jitsi track that will have backgraund effect applied. - */ - _jitsiTrack: Object, + * Whether or not multi-stream send support is enabled. + */ + _multiStreamModeEnabled: boolean, /** * Returns the selected thumbnail identifier. @@ -102,7 +108,8 @@ function _mapStateToProps(state): Object { _virtualBackground: state['features/virtual-background'], _selectedThumbnail: state['features/virtual-background'].selectedThumbnail, _showUploadButton: !(hasBrandingImages || state['features/base/config'].disableAddingBackgroundImages), - _jitsiTrack: getLocalVideoTrack(state['features/base/tracks'])?.jitsiTrack + _jitsiTrack: getLocalVideoTrack(state['features/base/tracks'])?.jitsiTrack, + _multiStreamModeEnabled: getMultipleVideoSendingSupportFeatureFlag(state) }; } @@ -256,6 +263,7 @@ function VirtualBackground({ _selectedThumbnail, _showUploadButton, _virtualBackground, + _multiStreamModeEnabled, dispatch, initialOptions, t @@ -266,7 +274,10 @@ function VirtualBackground({ const localImages = jitsiLocalStorage.getItem('virtualBackgrounds'); const [ storedImages, setStoredImages ] = useState>((localImages && Bourne.parse(localImages)) || []); const [ loading, setLoading ] = useState(false); - const { disableScreensharingVirtualBackground } = useSelector(state => state['features/base/config']); + let { disableScreensharingVirtualBackground } = useSelector(state => state['features/base/config']); + + // Disable screenshare as virtual background in multi-stream mode. + disableScreensharingVirtualBackground = disableScreensharingVirtualBackground || _multiStreamModeEnabled; const [ activeDesktopVideo ] = useState(_virtualBackground?.virtualSource?.videoType === VIDEO_TYPE.DESKTOP ? _virtualBackground.virtualSource