🚸(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:
committed by
aleb_the_flash
parent
12e2149b9e
commit
bbc2b1d9f6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user