PDA

View Full Version : event for MIDI finish?


Ganon of Evil
11-18-2002, 07:07 PM
i am making a jukebox that plays in the background of my site with a frame. I want the frame to refresh after the song is done playing so it can pick another random song to play (all it has to do is refresh). Is there any type of JavaScript event that occurs so once it is finished playing the frame reloads? Right now I am doing this:

<?php
$songlength*=1000;
?>
<html>
<head>
<title>BGMusic Frame</title>
<script language="JavaScript1.2">
function startTimer(){
setTimeout("location.reload()", <?php echo $songlength;?>);
}
</script>

</head>
<body onload="startTimer();">
<embed src="bgmusic/currentsong.mid" hidden="true">
</body>
</html>


And it works fine, but the problem is that I have to manualy enter the song length into a database which is very annoying. Any suggestions? I am sure there is a way to do this somehow, but cant figure it out. Thanks. BTW if you want to see it working it is at http://www.elite-gaming.com/bgmusic.php (video game music).