[Glitch] Fix incorrect progress value being passed to react-spring in video player
Port ef87cd6910d4d7c625eda5c65b594e17b172b348 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
87c139d393
commit
8bb924105c
@ -350,8 +350,10 @@ export const Video: React.FC<{
|
|||||||
const updateProgress = () => {
|
const updateProgress = () => {
|
||||||
nextFrame = requestAnimationFrame(() => {
|
nextFrame = requestAnimationFrame(() => {
|
||||||
if (videoRef.current) {
|
if (videoRef.current) {
|
||||||
|
const progress =
|
||||||
|
videoRef.current.currentTime / videoRef.current.duration;
|
||||||
void api.start({
|
void api.start({
|
||||||
progress: `${(videoRef.current.currentTime / videoRef.current.duration) * 100}%`,
|
progress: isNaN(progress) ? '0%' : `${progress * 100}%`,
|
||||||
immediate: reduceMotion,
|
immediate: reduceMotion,
|
||||||
config: config.stiff,
|
config: config.stiff,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user