From b25110dfe3b8f12da871912df6a5da4b5692fe21 Mon Sep 17 00:00:00 2001 From: Yuri Tatishchev Date: Fri, 6 Feb 2026 03:58:09 -0800 Subject: [PATCH] player scrubber sync attempt --- src/lib/components/GlobalPlayer.svelte | 52 +++++--------------------- 1 file changed, 9 insertions(+), 43 deletions(-) diff --git a/src/lib/components/GlobalPlayer.svelte b/src/lib/components/GlobalPlayer.svelte index de75c73..8b15a4e 100644 --- a/src/lib/components/GlobalPlayer.svelte +++ b/src/lib/components/GlobalPlayer.svelte @@ -62,11 +62,6 @@ let currentTime = $state(0); let duration = $state(0); - // Seek scrubber value that both mobile + desktop sliders bind to. - // We keep it in sync with `currentTime` unless the user is actively dragging. - let scrubValue = $state(0); - let isScrubbing = $state(false); - // local UI derived from viewport; not persisted let isMobile = $state(false); @@ -129,20 +124,8 @@ }, }); - function onScrubInput(e: Event) { - if (!audioEl) return; - const next = Number((e.currentTarget as HTMLInputElement).value); - if (!Number.isFinite(next)) return; - - isScrubbing = true; - scrubValue = next; - audioEl.currentTime = Math.max(0, next); - } - - function onScrubCommit() { - // Release "user is dragging" mode so timeupdate can drive the UI again. - isScrubbing = false; - } + // Scrubber is now driven by `bind:currentTime` on the