0

I have written a little customized audio player with a playlist. The playlist is a list of mp3 files found in a particular folder. They are displayed correctly in a table on my page and the file being played is highlighted as intended. I used sprite images for the audio-player controls and when I hover over the sprite images they are highlighted as they should be. Also when I click on any of sprites, the appropriate action is correctly retrieved (Play, Stop, Next Prev) and passed on to the relevant JS function. I also put two buttons on the page for (parallel) comparison purposes whilst I was developing the audio-player sprite controls. My problem is that when I click the buttons (Next, Previous) the script behaves exactly as I would want it to. The buttons allow me to scroll through the playlist and the songs play as and when they are highlighted. However when I click on the corresponding sprite images (for Next and Prev) the same functions (as invoked by the buttons) seem to behave differently. For some reason, when I select 'Next' or 'Prev', the mp3 played always reverts to the first on the list. I am relatively new to JS but keen to learn. :-) Any thoughts?

0 Answers0