fix(virtual-background) Do not allow desktop as virtual background when multi-stream is enabled.

This commit is contained in:
Jaya Allamsetty 2022-07-06 15:47:06 -04:00
parent b9b8090996
commit 76f7f3943f
1 changed files with 16 additions and 5 deletions

View File

@ -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<Image>,
/**
* 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.
* Whether or not multi-stream send support is enabled.
*/
_jitsiTrack: Object,
_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<Array<Image>>((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