stop button bug fix

This commit is contained in:
cottongin 2026-01-17 13:59:33 -05:00
parent f3399a87b4
commit 27b1f0213e
No known key found for this signature in database
GPG Key ID: 0ECC91FE4655C262

View File

@ -1774,7 +1774,15 @@
// Direct URL - browser handles caching via HTTP headers
audio.src = playlist[0].url;
// 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)