[Glitch] Fix incorrect progress value being passed to react-spring in video player

Port ef87cd6910 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-05-20 15:12:08 +02:00
parent 87c139d393
commit 8bb924105c

View File

@@ -350,8 +350,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,
});