stop button bug fix
This commit is contained in:
parent
f3399a87b4
commit
27b1f0213e
14
index.html
14
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user