feat: go to next song when the current one ends
This commit is contained in:
@@ -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() {
|
||||||
|
Reference in New Issue
Block a user