snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
27
react/features/virtual-background/hooks.ts
Normal file
27
react/features/virtual-background/hooks.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { isScreenVideoShared } from '../screen-share/functions';
|
||||
|
||||
import VideoBackgroundButton from './components/VideoBackgroundButton';
|
||||
import { checkBlurSupport, checkVirtualBackgroundEnabled } from './functions';
|
||||
|
||||
const virtualBackground = {
|
||||
key: 'select-background',
|
||||
Content: VideoBackgroundButton,
|
||||
group: 3
|
||||
};
|
||||
|
||||
/**
|
||||
* A hook that returns the virtual background button if it is enabled and undefined otherwise.
|
||||
*
|
||||
* @returns {Object | undefined}
|
||||
*/
|
||||
export function useVirtualBackgroundButton() {
|
||||
const _checkBlurSupport = checkBlurSupport();
|
||||
const _isScreenVideoShared = useSelector(isScreenVideoShared);
|
||||
const _checkVirtualBackgroundEnabled = useSelector(checkVirtualBackgroundEnabled);
|
||||
|
||||
if (_checkBlurSupport && !_isScreenVideoShared && _checkVirtualBackgroundEnabled) {
|
||||
return virtualBackground;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user