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)