I WANT TO RANDOMIZE THIS CODE: WE HAVE TO IMPROVE IT. 1- I NEED TO APPEAR THE NORMAL AUDIO PLAYER, AS A PICTURE APPEARS. 2- WHEN FINISHING A SONG DOES NOT CONTINUE WITH THE FOLLOWING. The code that makes the random is fine, you just have to improve the two previous aspects.
HELP - HELP !!!
var sounds = ["001.mp3", "002.mp3", "003.mp3", "004.mp3", "005.mp3"], oldSounds = []; var playSounds = function () { var index = Math.floor (Math.random () * (sounds.length)), thisSound = sounds [index]; oldSounds.push (thisSound); sounds.splice (index, 1); if (sounds.length "); }