mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 16:42:47 +00:00
Fix incorrect progress
value being passed to react-spring in video player (#34740)
This commit is contained in:
parent
042a9c42be
commit
ef87cd6910
|
@ -346,8 +346,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…
Reference in New Issue
Block a user