posted 22 years ago
Netscape uses the OBJECT tag, where IE uses the EMBED tag. Here's the code we use:
<Script language="JavaScript">
playerName = "audio";
fileName = 'audiofile.wav'; autoStart = 1;
width = 5; height = 5; showControls = 1;
if (!netscape) {
document.write('<object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" name="' + playerName + '"\
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"\
width="' + width + '" height="' + height + '" id="vPlayer" type="application/x-oleobject" standby="Loading Media File..." VIEWASTEXT>')
document.write('<param NAME="AutoStart" VALUE="' + autoStart + '">')
document.write('<param NAME="AutoRewind" VALUE="0">')
document.write('<param NAME="DisplayMode" VALUE="false">')
document.write('<param NAME="DisplaySize" VALUE="0">')
document.write('<param NAME="ShowControls" VALUE="' + showControls + '">')
document.write('<param NAME="ShowDisplay" VALUE="0">')
document.write('<param NAME="FileName" VALUE="' + fileName + '">')
}
if (netscape)
document.write('<EMBED TYPE="application/x-mplayer2" PLUGINSPAGE="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" SRC="' + fileName + '" AutoStart=' + autoStart + ' ShowDisplay=0 ShowControls=' + showControls + ' NAME="' + playerName + '" width="' + width + '" height="' + height + '"></EMBED>')
if (!netscape)
document.write('</object>');
</Script>