stop resize if user switches browser tab
This commit is contained in:
parent
c25ec18bd2
commit
7bc9ac82c0
@ -33,6 +33,20 @@ const WebcamComponent = ({
|
||||
|| cameraDock.position === CAMERADOCK_POSITION.CONTENT_RIGHT;
|
||||
const isCameraSidebar = cameraDock.position === CAMERADOCK_POSITION.SIDEBAR_CONTENT_BOTTOM;
|
||||
|
||||
useEffect(() => {
|
||||
const handleVisibility = () => {
|
||||
if (document.hidden) {
|
||||
document.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('visibilitychange', handleVisibility);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('visibilitychange', handleVisibility);
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setIsFullScreen(fullscreen.group === 'webcams');
|
||||
}, [fullscreen]);
|
||||
|
Loading…
Reference in New Issue
Block a user