From 9ab89d81f27c5da0784a73f76a9c8bb677c3081d Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Mon, 23 Sep 2024 16:57:36 +0200 Subject: [PATCH] ui: debugging audio --- .../components/Session/Player/ReplayPlayer/AudioPlayer.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app/components/Session/Player/ReplayPlayer/AudioPlayer.tsx b/frontend/app/components/Session/Player/ReplayPlayer/AudioPlayer.tsx index 70e13c16e..49cc7767c 100644 --- a/frontend/app/components/Session/Player/ReplayPlayer/AudioPlayer.tsx +++ b/frontend/app/components/Session/Player/ReplayPlayer/AudioPlayer.tsx @@ -34,7 +34,7 @@ function DropdownAudioPlayer({ timestamp: data.timestamp, start: pa.timestamp - sessionStart, }; - }), [audioEvents, sessionStart]) + }), [audioEvents.length, sessionStart]) React.useEffect(() => { Object.entries(audioRefs.current).forEach(([url, audio]) => { @@ -118,7 +118,8 @@ function DropdownAudioPlayer({ useEffect(() => { const deltaMs = delta * 1000; - if (Math.abs(lastPlayerTime.current - time - deltaMs) >= 250) { + const deltaTime = Math.abs(lastPlayerTime.current - time - deltaMs) + if (deltaTime >= 250) { handleSeek(time); } Object.entries(audioRefs.current).forEach(([url, audio]) => {