Fix safari issue

This commit is contained in:
Zoe Roux 2023-09-12 18:03:56 +02:00
parent ec2b0e0f78
commit 385c580358
No known key found for this signature in database
2 changed files with 7 additions and 5 deletions

View File

@ -100,10 +100,10 @@ const VolumeSlider = () => {
isMuted || volume == 0 isMuted || volume == 0
? VolumeOff ? VolumeOff
: volume < 25 : volume < 25
? VolumeMute ? VolumeMute
: volume < 65 : volume < 65
? VolumeDown ? VolumeDown
: VolumeUp : VolumeUp
} }
onPress={() => setMuted(!isMuted)} onPress={() => setMuted(!isMuted)}
{...tooltip(t("player.mute"), true)} {...tooltip(t("player.mute"), true)}
@ -132,8 +132,8 @@ const ProgressText = () => {
}; };
const toTimerString = (timer?: number, duration?: number) => { const toTimerString = (timer?: number, duration?: number) => {
if (timer === undefined) return "??:??";
if (!duration) duration = timer; if (!duration) duration = timer;
if (timer === undefined || duration === undefined || isNaN(duration) || isNaN(timer)) return "??:??";
if (duration >= 3600) return new Date(timer * 1000).toISOString().substring(11, 19); if (duration >= 3600) return new Date(timer * 1000).toISOString().substring(11, 19);
return new Date(timer * 1000).toISOString().substring(14, 19); return new Date(timer * 1000).toISOString().substring(14, 19);
}; };

View File

@ -185,6 +185,8 @@ const Video = forwardRef<{ seek: (value: number) => void }, VideoProps>(function
src={source.uri} src={source.uri}
muted={muted} muted={muted}
autoPlay={!paused} autoPlay={!paused}
controls={false}
playsInline
onCanPlay={() => onBuffer?.call(null, { isBuffering: false })} onCanPlay={() => onBuffer?.call(null, { isBuffering: false })}
onWaiting={() => onBuffer?.call(null, { isBuffering: true })} onWaiting={() => onBuffer?.call(null, { isBuffering: true })}
onDurationChange={() => { onDurationChange={() => {