In <body> I have this code <object id="song" name="song" data="file.mp3" type="application/x-mplayer2" width="0" height="0" style="position:absolute;"> <param name="filename" value="file.mp3"> <param name="autostart" value="0"> <param name="playcount" value="1"> <param name="loop" value="false" /> <param name="repeat" value="false" /> </object> Code (markup): I call at OnLoad function play_song() with code document.song.Play(); Code (markup): In IE it works fine, but in FireFox and Opera it doesn't work. Have anyone any idea why? I tried document.applets["song"].Play() Code (markup): or document.applets[0].Play() Code (markup): with the same result.
Try play() (lowercase "p") EDIT: Chances are that Firefox and Opera don't support this. http://www.javascripter.net/faq/sound/browsers.htm http://www.javascripter.net/faq/sound/play.htm