fix: enforce automatic startup jingle

This commit is contained in:
Jacques_tirot
2026-08-26 14:33:10 +02:00
parent bc7edcf3a7
commit fe51439bbe
3 changed files with 35 additions and 31 deletions
+19 -16
View File
@@ -16,6 +16,7 @@ const FullscreenIntroVideo = ({
visible = true, visible = true,
onClose, onClose,
contentFit = 'contain', contentFit = 'contain',
allowSkip = true,
skipLabel = 'Passer la vidéo', skipLabel = 'Passer la vidéo',
}) => { }) => {
const source = url ? (typeof url === 'string' ? { uri: url } : url) : videos.test const source = url ? (typeof url === 'string' ? { uri: url } : url) : videos.test
@@ -120,22 +121,24 @@ const FullscreenIntroVideo = ({
// right: 24, // right: 24,
// }} // }}
/> />
<Pressable {allowSkip ? (
onPress={handleClose} <Pressable
style={{ onPress={handleClose}
position: 'absolute', style={{
top: 50, position: 'absolute',
right: 20, top: 50,
backgroundColor: '#00000080', right: 20,
paddingVertical: 10, backgroundColor: '#00000080',
paddingHorizontal: 14, paddingVertical: 10,
borderRadius: 20, paddingHorizontal: 14,
borderWidth: 1, borderRadius: 20,
borderColor: '#FFFFFF55', borderWidth: 1,
}} borderColor: '#FFFFFF55',
> }}
<Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text> >
</Pressable> <Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text>
</Pressable>
) : null}
</View> </View>
</Portal> </Portal>
) )
+9 -3
View File
@@ -62,6 +62,7 @@ const FullscreenIntroVideo = ({
visible = true, visible = true,
onClose, onClose,
contentFit = 'cover', contentFit = 'cover',
allowSkip = true,
requireAudio = false, requireAudio = false,
skipLabel = 'Passer la vidéo', skipLabel = 'Passer la vidéo',
playLabel = 'Lire la vidéo avec le son', playLabel = 'Lire la vidéo avec le son',
@@ -150,7 +151,10 @@ const FullscreenIntroVideo = ({
if (error?.name === 'NotAllowedError' && requireAudio) { if (error?.name === 'NotAllowedError' && requireAudio) {
setAwaitingInteraction(true) setAwaitingInteraction(true)
} else if (error?.name === 'NotAllowedError' && !muted) { } else if (error?.name === 'NotAllowedError' && !muted) {
video.muted = true
setMuted(true) setMuted(true)
const mutedResult = video.play()
mutedResult?.catch?.(() => {})
} }
}) })
} }
@@ -224,9 +228,11 @@ const FullscreenIntroVideo = ({
<Text style={closeTextStyle}>{playLabel}</Text> <Text style={closeTextStyle}>{playLabel}</Text>
</Pressable> </Pressable>
) : null} ) : null}
<Pressable onPress={handleClose} style={closeButtonStyle}> {allowSkip ? (
<Text style={closeTextStyle}>{skipLabel}</Text> <Pressable onPress={handleClose} style={closeButtonStyle}>
</Pressable> <Text style={closeTextStyle}>{skipLabel}</Text>
</Pressable>
) : null}
</View> </View>
</Portal> </Portal>
) )
+7 -12
View File
@@ -76,18 +76,12 @@ export default function LandingPage({ route }) {
const activeVideoClose = const activeVideoClose =
phase === FLOW_PHASE.JINGLE ? handleJingleClose : handleWelcomeVideoClose phase === FLOW_PHASE.JINGLE ? handleJingleClose : handleWelcomeVideoClose
const skipLabel = const isJingle = phase === FLOW_PHASE.JINGLE
phase === FLOW_PHASE.JINGLE const skipLabel = selectedLanguage === 'en' ? 'Skip video' : 'Passer la vidéo'
? 'Passer / Skip'
: selectedLanguage === 'en'
? 'Skip video'
: 'Passer la vidéo'
const playLabel = const playLabel =
phase === FLOW_PHASE.JINGLE selectedLanguage === 'en'
? 'Lancer le jingle / Play jingle' ? 'Play video with sound'
: selectedLanguage === 'en' : 'Lire la vidéo avec le son'
? 'Play video with sound'
: 'Lire la vidéo avec le son'
return ( return (
<> <>
@@ -128,7 +122,8 @@ export default function LandingPage({ route }) {
visible visible
onClose={activeVideoClose} onClose={activeVideoClose}
contentFit="contain" contentFit="contain"
requireAudio allowSkip={!isJingle}
requireAudio={!isJingle}
skipLabel={skipLabel} skipLabel={skipLabel}
playLabel={playLabel} playLabel={playLabel}
/> />