mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-28 13:47:23 +00:00
[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:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user