Fix incorrect progress value being passed to react-spring in video player (#34740)

This commit is contained in:
Claire 2025-05-20 15:12:08 +02:00 committed by GitHub
parent 042a9c42be
commit ef87cd6910
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -346,8 +346,10 @@ export const Video: React.FC<{
const updateProgress = () => {
nextFrame = requestAnimationFrame(() => {
if (videoRef.current) {
const progress =
videoRef.current.currentTime / videoRef.current.duration;
void api.start({
progress: `${(videoRef.current.currentTime / videoRef.current.duration) * 100}%`,
progress: isNaN(progress) ? '0%' : `${progress * 100}%`,
immediate: reduceMotion,
config: config.stiff,
});