PDA

For continued disscussion on this topic : need midirandom with autoreload



dierklb
07-01-2000, 11:16 PM
I'm looking for a javascript that will reload the page after the midi stops playing. Maybe taking the event that the smallconsole changes to stop or getting the timelength of the midi and on elapsed time to give the order to refresh(reload) the page. Look at the problem at URL:
http.//www.intena.net.mx/music.htm
I just want another midi to be selected after the one playing stops, but automatically and not by manual reload.
Please help me

Kool Dude
07-02-2000, 07:43 AM
Don't know if the end of a midi playing is an event that can be captured yet or not.. if I find out more I'll post if fer ya though..
:)

Vincent Puglia
07-02-2000, 02:10 PM
hola dierklb,

I noticed you cut&pasted your script. Does this mean you don't code? If so, you'll have to give me some time.
Else:
1) change is "loop=infinite" and maybe the "loop=true". (i forget if the true-loop is the midiplayer only)
2) relocate the embed code out of the body section. make the second document.write a function.
3) Then put the randomizing code within a function and have it call the embed src='...+ midi ..." code
4) call everything from an onLoad event handler. <...onLoad="playThem('randomMidi')">
5)you may be able to use the dom (document object model) to see if the song is finished (i'd have to check, but if it exists, it should be something like
if(document.embed[0].src)
if you can't check that way, you'll have to set up a setTimeOut() based on the length of the longest playing song.

Vinny