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.

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/


<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))

if (x == (1))

if (x == (2))

if (x == (3))

if (x == (4))

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 -->

<!-- begin MIDI -->

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

<!-- end MIDI -->