From 27b1f0213e756e764de2e50d46140c2ee1673086 Mon Sep 17 00:00:00 2001 From: cottongin Date: Sat, 17 Jan 2026 13:59:33 -0500 Subject: [PATCH] stop button bug fix --- index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index bc433c9..f2aea3a 100644 --- a/index.html +++ b/index.html @@ -1774,7 +1774,15 @@ // Direct URL - browser handles caching via HTTP headers audio.src = playlist[0].url; - audio.load(); + + // Wait for audio to be ready before setting currentTime + await new Promise(resolve => { + audio.addEventListener('loadedmetadata', function onMeta() { + audio.removeEventListener('loadedmetadata', onMeta); + resolve(); + }); + audio.load(); + }); } audio.currentTime = 0; @@ -1784,6 +1792,10 @@ tapeRight.classList.remove('spinning'); resetTitleScroll(); resetTapeSizes(); // Ensure tape visuals are at beginning + + // Manually update time display since timeupdate doesn't fire when paused + const duration = formatTime(audio.duration); + timeDisplay.textContent = `00:00 / ${duration}`; }); // Previous track (prev button with bar)