fix: enforce automatic startup jingle
This commit is contained in:
@@ -62,6 +62,7 @@ const FullscreenIntroVideo = ({
|
||||
visible = true,
|
||||
onClose,
|
||||
contentFit = 'cover',
|
||||
allowSkip = true,
|
||||
requireAudio = false,
|
||||
skipLabel = 'Passer la vidéo',
|
||||
playLabel = 'Lire la vidéo avec le son',
|
||||
@@ -150,7 +151,10 @@ const FullscreenIntroVideo = ({
|
||||
if (error?.name === 'NotAllowedError' && requireAudio) {
|
||||
setAwaitingInteraction(true)
|
||||
} else if (error?.name === 'NotAllowedError' && !muted) {
|
||||
video.muted = true
|
||||
setMuted(true)
|
||||
const mutedResult = video.play()
|
||||
mutedResult?.catch?.(() => {})
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -224,9 +228,11 @@ const FullscreenIntroVideo = ({
|
||||
<Text style={closeTextStyle}>{playLabel}</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
<Pressable onPress={handleClose} style={closeButtonStyle}>
|
||||
<Text style={closeTextStyle}>{skipLabel}</Text>
|
||||
</Pressable>
|
||||
{allowSkip ? (
|
||||
<Pressable onPress={handleClose} style={closeButtonStyle}>
|
||||
<Text style={closeTextStyle}>{skipLabel}</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
</Portal>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user