fix: improve onboarding audio and mobile layout
This commit is contained in:
@@ -64,6 +64,7 @@ const FullscreenIntroVideo = ({
|
||||
contentFit = 'cover',
|
||||
allowSkip = true,
|
||||
requireAudio = false,
|
||||
offerSoundActivation = false,
|
||||
skipLabel = 'Passer la vidéo',
|
||||
playLabel = 'Lire la vidéo avec le son',
|
||||
}) => {
|
||||
@@ -153,6 +154,7 @@ const FullscreenIntroVideo = ({
|
||||
} else if (error?.name === 'NotAllowedError' && !muted) {
|
||||
video.muted = true
|
||||
setMuted(true)
|
||||
setAwaitingInteraction(offerSoundActivation)
|
||||
const mutedResult = video.play()
|
||||
mutedResult?.catch?.(() => {})
|
||||
}
|
||||
@@ -171,7 +173,7 @@ const FullscreenIntroVideo = ({
|
||||
const video = videoRef.current
|
||||
video?.pause()
|
||||
}
|
||||
}, [evaluateShouldClose, muted, requireAudio, uri, visible])
|
||||
}, [evaluateShouldClose, muted, offerSoundActivation, requireAudio, uri, visible])
|
||||
|
||||
const handleManualPlay = useCallback(() => {
|
||||
const video = videoRef.current
|
||||
|
||||
Reference in New Issue
Block a user