stop button bug fix
This commit is contained in:
14
index.html
14
index.html
@@ -1774,7 +1774,15 @@
|
|||||||
|
|
||||||
// Direct URL - browser handles caching via HTTP headers
|
// Direct URL - browser handles caching via HTTP headers
|
||||||
audio.src = playlist[0].url;
|
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;
|
audio.currentTime = 0;
|
||||||
@@ -1784,6 +1792,10 @@
|
|||||||
tapeRight.classList.remove('spinning');
|
tapeRight.classList.remove('spinning');
|
||||||
resetTitleScroll();
|
resetTitleScroll();
|
||||||
resetTapeSizes(); // Ensure tape visuals are at beginning
|
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)
|
// Previous track (prev button with bar)
|
||||||
|
|||||||
Reference in New Issue
Block a user