PDA

View Full Version : firefox/IE audio compatibility problem



Sector 6 Slum
04-11-2006, 08:15 PM
EDIT: i've decided to remove the music from the blog so i wont have to worry about this problem anymore.
-----------------------------------------------------------------------
hi,

i've started a blog few months and i've been playing around with the templates and trying and adding new stuff.

i've recently added midi songs to the blog and i used a javascript which would allow me to play a random midi song (see below). I've also put a 10 seconds delay before the song starts to play by using the 'setTimeout'.

The problem: the delay works fine with IE but not with firefox. In Firefox, you'll have to click play for the songs to start.

Could anyone help me? I'm not a programmer and most of the codes that i use are either taken and modified from other places.

This is my blog http://sector6slumjunkshop.blogspot.com/

Thanks,
shalom

------------------------------------------------------------------------
<script type="text/javascript" language="javascript" >
<!-- Begin

function RandomMIDI() {

tagLines = new Array(5);
tagLines[0] = "<p>Chloe, from Noir</p>";
tagLines[1] = "<p>Melody, from Noir</p>";
tagLines[2] = "<p>Canta per me, from Noir</p>";
tagLines[3] = "<p>Lilium, OP from Elfen Lied</p>";
tagLines[4] = "<p>Julia, from FF8</p>";

nummidi = 5
day = new Date()
z = day.getTime()
y = (z - (parseInt(z/1000,10) * 1000))/10
x = parseInt(y/100*nummidi,10)

if (x == (0))
midi=("http://sector6slumjunkshop.castpost.com/chloe.mid")

if (x == (1))
midi=("http://sector6slumjunkshop.castpost.com/melody_salva_nos_version.mid")

if (x == (2))
midi=("http://sector6slumjunkshop.castpost.com/canta_per_me.mid")

if (x == (3))
midi=("http://sector6slumjunkshop.castpost.com/LiliumMusicBox.mid")

if (x == (4))
midi=("http://sector6slumjunkshop.castpost.com/1-20-Julia.mid")

document.write('<EMBED SRC= ' + midi + ' autostart="FALSE" id="sound" ')
document.write('align="center" width=145 height=40 >' )
document.write("<FONT FACE='Verdana' SIZE='1'>" + tagLines[x] + "</FONT>");

}

// End -->
</script>

<!-- begin MIDI -->

<script type="text/javascript" language="javascript" >
<!-- Hide
RandomMIDI();
setTimeout('document.getElementById("sound").Play()', 10000);
// Unhide -->
</script>

<!-- end MIDI -->
----------------------------------------------------------------