Click to See Complete Forum and Search --> : music not playing in mozilla/firefox


jasonc310771
10-29-2006, 11:39 AM
Below is the code that will play music in Internet Explorer and Netscape but i do not have any code to allow us to play music in a FireFox mozilla browser!
does anyone have any ideas what i should use to get this to work.

thanks in advance for your help.

[code]<SCRIPT TYPE="text/javascript">
<!--
var filename="music/MySong.wav";
if (navigator.appName == "Microsoft Internet Explorer")
document.writeln ('<BGSOUND SRC="' + filename + '">');
else if (navigator.appName == "Netscape")
document.writeln ('<EMBED SRC="' + filename + '" AUTOSTART=TRUE WIDTH=144 HEIGHT=60><P>');
// -->
</SCRIPT>
<NOSCRIPT>
<EMBED SRC="music/MySong.wav"></EMBED>
</NOSCRIPT>[code]

felgall
10-29-2006, 01:39 PM
There is no such tag as <bgsound> or <embed>. The tag for attaching any sort of object (such as sound) to a web page is the <object> tag.

HomerJSimpson
10-29-2006, 03:54 PM
I don't know what you try to do..but your code is very confusing...

common code for music is this

<embed src="hello.wma" width="150" height="30" autostart="true"></embed>

hope this help

jasonc310771
10-29-2006, 10:28 PM
i have looked around and only find a few pages about this code!

please could you elaborate on how i use this code to play music.

ta


There is no such tag as <bgsound> or <embed>. The tag for attaching any sort of object (such as sound) to a web page is the <object> tag.

stacywacy
10-30-2006, 12:15 AM
Here's information about the object element.
http://www.w3.org/TR/html4/struct/objects.html

I tried using it once and found it worked in Firefox and not IE for me, so I switched back to the <embed> tag. Haven't tried the <object> tag lately though.
.