mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 05:50:52 +02:00
fix: pause button toggles between pause and resume
This commit is contained in:
parent
61cdc6fd53
commit
9863ca7911
1 changed files with 6 additions and 2 deletions
|
|
@ -1502,8 +1502,12 @@ playBtn.addEventListener('click', () => {
|
||||||
});
|
});
|
||||||
pauseBtn.addEventListener('click', () => {
|
pauseBtn.addEventListener('click', () => {
|
||||||
if (currentIndex < 0) return;
|
if (currentIndex < 0) return;
|
||||||
|
if (audio.paused) {
|
||||||
|
audio.play().catch(() => {});
|
||||||
|
} else {
|
||||||
audio.pause();
|
audio.pause();
|
||||||
if (isCrossfading) audioNext.pause();
|
if (isCrossfading) audioNext.pause();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
stopBtn.addEventListener('click', () => {
|
stopBtn.addEventListener('click', () => {
|
||||||
if (currentIndex < 0) return;
|
if (currentIndex < 0) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue