I am working on an web audio player using html/css and javascript.
The player uses a list to store the songs currently, and displays the list at the bottom of the player as a playlist.
I want to make it so that when I click on a list item, the audio for that list item starts to play.
This is the code I have currently:
//Click Song Title
$('#playlist li').click(function(){
audio.play();
$('#play').hide();
$('#pause').show();
$('#duration').fadeIn(400);
showDuration();
});
It works, except that no matter which list item I click on it just plays the first list item's song. It also only works if the player is freshly loaded or the song is paused.
If you need to know what else is going on in the code let me know.
