fix: enforce automatic startup jingle
This commit is contained in:
@@ -16,6 +16,7 @@ const FullscreenIntroVideo = ({
|
||||
visible = true,
|
||||
onClose,
|
||||
contentFit = 'contain',
|
||||
allowSkip = true,
|
||||
skipLabel = 'Passer la vidéo',
|
||||
}) => {
|
||||
const source = url ? (typeof url === 'string' ? { uri: url } : url) : videos.test
|
||||
@@ -120,22 +121,24 @@ const FullscreenIntroVideo = ({
|
||||
// right: 24,
|
||||
// }}
|
||||
/>
|
||||
<Pressable
|
||||
onPress={handleClose}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 50,
|
||||
right: 20,
|
||||
backgroundColor: '#00000080',
|
||||
paddingVertical: 10,
|
||||
paddingHorizontal: 14,
|
||||
borderRadius: 20,
|
||||
borderWidth: 1,
|
||||
borderColor: '#FFFFFF55',
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text>
|
||||
</Pressable>
|
||||
{allowSkip ? (
|
||||
<Pressable
|
||||
onPress={handleClose}
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 50,
|
||||
right: 20,
|
||||
backgroundColor: '#00000080',
|
||||
paddingVertical: 10,
|
||||
paddingHorizontal: 14,
|
||||
borderRadius: 20,
|
||||
borderWidth: 1,
|
||||
borderColor: '#FFFFFF55',
|
||||
}}
|
||||
>
|
||||
<Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text>
|
||||
</Pressable>
|
||||
) : null}
|
||||
</View>
|
||||
</Portal>
|
||||
)
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
|
||||
@@ -76,18 +76,12 @@ export default function LandingPage({ route }) {
|
||||
|
||||
const activeVideoClose =
|
||||
phase === FLOW_PHASE.JINGLE ? handleJingleClose : handleWelcomeVideoClose
|
||||
const skipLabel =
|
||||
phase === FLOW_PHASE.JINGLE
|
||||
? 'Passer / Skip'
|
||||
: selectedLanguage === 'en'
|
||||
? 'Skip video'
|
||||
: 'Passer la vidéo'
|
||||
const isJingle = phase === FLOW_PHASE.JINGLE
|
||||
const skipLabel = selectedLanguage === 'en' ? 'Skip video' : 'Passer la vidéo'
|
||||
const playLabel =
|
||||
phase === FLOW_PHASE.JINGLE
|
||||
? 'Lancer le jingle / Play jingle'
|
||||
: selectedLanguage === 'en'
|
||||
? 'Play video with sound'
|
||||
: 'Lire la vidéo avec le son'
|
||||
selectedLanguage === 'en'
|
||||
? 'Play video with sound'
|
||||
: 'Lire la vidéo avec le son'
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -128,7 +122,8 @@ export default function LandingPage({ route }) {
|
||||
visible
|
||||
onClose={activeVideoClose}
|
||||
contentFit="contain"
|
||||
requireAudio
|
||||
allowSkip={!isJingle}
|
||||
requireAudio={!isJingle}
|
||||
skipLabel={skipLabel}
|
||||
playLabel={playLabel}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user