🚸(frontend) avoid displaying the effects option when not optimal

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.
This commit is contained in:
lebaudantoine
2025-01-31 11:58:21 +01:00
committed by aleb_the_flash
parent 12e2149b9e
commit bbc2b1d9f6

View File

@@ -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 (
<>
<Dialog