Refactored to reflect changes in audioPlayerPlaylist.js

This commit is contained in:
Anon 2024-02-11 18:08:18 -08:00
parent febac5c7d5
commit 0b20391c65

View File

@ -66,9 +66,9 @@ function audioPlayer()
currentSong = wrap(idx, aListLinks.length) currentSong = wrap(idx, aListLinks.length)
aListLinks[currentSong].classList.add("current-song"); aListLinks[currentSong].classList.add("current-song");
aPlay.src = musicList[currentSong][0] aPlay.src = musicList[currentSong][3]
aTrack.innerHTML = musicList[currentSong][1] aTrack.innerHTML = musicList[currentSong][0]
aArtist.innerHTML = musicList[currentSong][2] aArtist.innerHTML = musicList[currentSong][1]
aCoverArt.src = musicList[currentSong][4] aCoverArt.src = musicList[currentSong][4]
if (doplay === true) if (doplay === true)
{ {
@ -77,7 +77,9 @@ function audioPlayer()
} }
musicList.forEach((value, index, array) => { musicList.forEach((value, index, array) => {
const el = appendMusicList(aList, value[1], value[3]) const trackTitle = value[0]
const trackTime = value[2]
const el = appendMusicList(aList, trackTitle, trackTime)
aListLinks.push(el) aListLinks.push(el)
el.addEventListener("click", () => { el.addEventListener("click", () => {
// el.preventDefault(); // el.preventDefault();