From 7ce43ef41248e4b61ffa18f3ae786ec3dd683a5a Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Tue, 20 Feb 2024 14:12:38 +0100 Subject: [PATCH] fix(ui): cap video framerate for mobile to 100hz --- .../components/Session/Player/MobilePlayer/ReplayWindow.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/Session/Player/MobilePlayer/ReplayWindow.tsx b/frontend/app/components/Session/Player/MobilePlayer/ReplayWindow.tsx index 7ef6cde97..a3c1f85d2 100644 --- a/frontend/app/components/Session/Player/MobilePlayer/ReplayWindow.tsx +++ b/frontend/app/components/Session/Player/MobilePlayer/ReplayWindow.tsx @@ -22,7 +22,8 @@ function ReplayWindow({ videoURL, userDevice }: Props) { React.useEffect(() => { if (videoRef.current) { const timeSecs = time / 1000 - if (videoRef.current.duration >= timeSecs) { + const delta = videoRef.current.currentTime - timeSecs + if (videoRef.current.duration >= timeSecs && Math.abs(delta) > 0.1) { videoRef.current.currentTime = timeSecs } }