
Originally Posted by
riptide
IE is giving me an error when I try and play it. It says ctr is not defined.
It's not. Try:
Code:
function playSongs(){
var arr, len;
var sel = document.forms[0].sel3;
var defaultLen = 310; //6 mins
if (playSongs.ctr<sel.options.length){
arr = sel.options[playSongs.ctr].value.split("|");
if (arr.length>0 && arr[0]){
len = (Number(arr[1]))? Number(arr[1])*1000:defaultLen*1000; //in milliseconds
document.getElementById('music1').innerHTML='<object width="500" height="450" id="Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"><param name="URL" value="'+arr[0]+'"><param name="autoStart" VALUE="true"><param name="uiMode" value="full"><param name="currentPosition" vaule="1" ><param name="ShowStatusBar" value="true" ><embed type="application/x-mplayer2" src="'+arr[0]+'" ShowControls="0" width="300" height="300"></embed></object>';
}
playSongs.ctr++;
setTimeout(playSongs);
}
}
playSongs.ctr = 0;
and later:
Code:
<input type="button" value="Play" onclick="playSongs.ctr = 0; playSongs()" />
Bookmarks