fix: pause button toggles between pause and resume

This commit is contained in:
Armin 2026-07-08 17:17:29 +02:00
commit 9863ca7911

View file

@ -1502,8 +1502,12 @@ playBtn.addEventListener('click', () => {
});
pauseBtn.addEventListener('click', () => {
if (currentIndex < 0) return;
audio.pause();
if (isCrossfading) audioNext.pause();
if (audio.paused) {
audio.play().catch(() => {});
} else {
audio.pause();
if (isCrossfading) audioNext.pause();
}
});
stopBtn.addEventListener('click', () => {
if (currentIndex < 0) return;