View Full Version : Need help tweaking music player code

12-07-2010, 07:30 PM
I hope someone can help me...I need to tweak this code so that background music will play randomly for an unlimited time. Right now, it plays a random song and then repeats it over and over. I just need to have it randomly change songs and keep playing! Here is the code I am using...

<script type="text/javascript">

var musicSource = [

var rand = Math.floor(Math.random()*musicSource.length);
document.write('<embed src="'+musicSource[rand]+'" autoplay="true" hidden="true" loop="true" />');

// -->

I think this is simple but I am a total noob at javascript! Thanks in advance!