fix: enforce automatic startup jingle
This commit is contained in:
@@ -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,6 +121,7 @@ const FullscreenIntroVideo = ({
|
|||||||
// right: 24,
|
// right: 24,
|
||||||
// }}
|
// }}
|
||||||
/>
|
/>
|
||||||
|
{allowSkip ? (
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={handleClose}
|
onPress={handleClose}
|
||||||
style={{
|
style={{
|
||||||
@@ -136,6 +138,7 @@ const FullscreenIntroVideo = ({
|
|||||||
>
|
>
|
||||||
<Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text>
|
<Text style={{ color: '#FFF', fontSize: 14 }}>{skipLabel}</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
) : null}
|
||||||
</View>
|
</View>
|
||||||
</Portal>
|
</Portal>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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}
|
||||||
|
{allowSkip ? (
|
||||||
<Pressable onPress={handleClose} style={closeButtonStyle}>
|
<Pressable onPress={handleClose} style={closeButtonStyle}>
|
||||||
<Text style={closeTextStyle}>{skipLabel}</Text>
|
<Text style={closeTextStyle}>{skipLabel}</Text>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
|
) : null}
|
||||||
</View>
|
</View>
|
||||||
</Portal>
|
</Portal>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -76,16 +76,10 @@ 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'
|
|
||||||
: selectedLanguage === 'en'
|
|
||||||
? 'Play video with sound'
|
? 'Play video with sound'
|
||||||
: 'Lire la vidéo avec le son'
|
: 'Lire la vidéo avec le son'
|
||||||
|
|
||||||
@@ -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}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user