Click to See Complete Forum and Search --> : When i play music on my website windows media player shows up!


Pinteke
10-19-2003, 05:57 PM
Hey,

i've made a website but i want to improve it. I've some backgroundmusic and i wanno show a button to turn it on or off. But when i do this there is always a little screen of windows media player how do i remove this?:confused:

the code i used:
<script>

musi="track1.mp3"

function mus1()
{
if (t.options.selectedIndex==0){
mus.innerHTML="<embed src="+musi+" loop=-1>"
}
if (t.options.selectedIndex==1){
mus.innerHTML=""
}
}
document.write("<span id='mus' style='position:absolute;top'><embed src="+musi+" width=0 height=0 loop=-1></span>")
</script>

<select name="t" onChange=mus1() >
<option selected>Speel muziek
<option>Stop de muziek
</select>

WHat do i do wrong pls help me!
thx

fredmv
10-19-2003, 06:05 PM
Try this:<embed hidden=\"true\" src="+musi+" width=\"0\" height=\"0\" loop=\"-1\">
I hope that helps you out.

Pinteke
10-19-2003, 06:13 PM
sorry it didn't help :( but thanx for trying to help me!

fredmv
10-19-2003, 06:16 PM
That should have worked. However, you could always use CSS to do this:<style type="text/css">
embed {
display: none;
}
</style>
Good luck. ;)

Pinteke
10-19-2003, 06:18 PM
:) :D :) :D :) thank you it works

thx
Pinteke

fredmv
10-19-2003, 06:21 PM
You're welcome. :D

Pinteke
10-20-2003, 05:55 AM
:( now the music will not autostart when the website is oncan you help me again?

fredmv
10-20-2003, 09:18 AM
Along with the previous code I gave you, make sure the autostart attribute of the <embed> tag is set to true. For example:<embed hidden=\"true\" src="+musi+" width=\"0\" height=\"0\" loop=\"-1\" autostart=\"true\">Good luck.

Pinteke
10-21-2003, 10:00 AM
it doesn't work if you know another sort of code for this please say it cause i hate it that it doesn't work

greetz,
Pinteke

clairec666
10-21-2003, 10:17 AM
I found that how sound files play when linked/embedded from a normal html page depends on the user's internet explorer settings - sounds are set to open in windows media by default
However I know there is a way round this - I found a site that played music without opening windows media even though I had chosen in ie settings to open windows media............
I'll track down the site and have a look at the code, see how they did it