feat: go to next song when the current one ends

This commit is contained in:
2024-07-20 22:57:04 +01:00
parent fbc9a07c25
commit 602fe6bbb1

View File

@@ -17,9 +17,14 @@ function playAudio() {
}; };
currentAudio.onpause = () => { currentAudio.onpause = () => {
isPlaying = false; isPlaying = false;
volume = 0;
playBtn.innerText = "play"; playBtn.innerText = "play";
}; };
currentAudio.volume = volume; currentAudio.onended = () => {
volume = 0;
playAudio();
};
currentAudio.volume = 0;
currentAudio.play(); currentAudio.play();
@@ -31,6 +36,8 @@ function playAudio() {
function pauseAudio() { function pauseAudio() {
currentAudio.pause(); currentAudio.pause();
currentAudio.volume = 0;
volume = 0;
} }
function fadeIn() { function fadeIn() {