From bbc2b1d9f694abcc3fe6fecaa1d6757cbf26b52b Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 31 Jan 2025 11:58:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(frontend)=20avoid=20displaying=20t?= =?UTF-8?q?he=20effects=20option=20when=20not=20optimal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On unsupported browser showing this option whitout offering the blur effects to the user would be quite frustrating. At the moment, safari user cannot blur their background. Also, avoid offering the option on mobile which are really cpu-constrained devices. --- src/frontend/src/features/rooms/components/Join.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/frontend/src/features/rooms/components/Join.tsx b/src/frontend/src/features/rooms/components/Join.tsx index 64e890bc..d352f376 100644 --- a/src/frontend/src/features/rooms/components/Join.tsx +++ b/src/frontend/src/features/rooms/components/Join.tsx @@ -19,6 +19,7 @@ import { } from '../livekit/components/effects/EffectsConfiguration' import { usePersistentUserChoices } from '../livekit/hooks/usePersistentUserChoices' import { BackgroundBlurFactory } from '../livekit/components/blur' +import { isMobileBrowser } from '@livekit/components-core' const onError = (e: Error) => console.error('ERROR', e) @@ -30,6 +31,10 @@ const Effects = ({ const [isDialogOpen, setIsDialogOpen] = useState(false) const openDialog = () => setIsDialogOpen(true) + if (!BackgroundBlurFactory.isSupported() || isMobileBrowser()) { + return + } + return ( <>