Følgende programkode (med eksempler på fil-/hostnavne) indsætter en Windows Media Player i en Web side, og den kan afspilles i både Internet Explorer samt Netscape Navigator:
<SCRIPT language=JavaScript>
<!--
if ( navigator.appName == "Netscape" )
{
//-- This next line ensures that any plugins just installed are updated in the Browser
//-- without quitting the browser.
navigator.plugins.refresh();
// We don't need the APPLET within IE
// ***Please note that if you do not need to script events, you can safely remove the next two lines
document.write("\x3C" + "applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class")
document.writeln(" width=5 height=5 name=appObs\x3E \x3C/applet\x3E")
}
//-->
<!--
if ( navigator.appName == "Netscape" )
{
//-- This next line ensures that any plugins just installed are updated in the Browser
//-- without quitting the browser.
navigator.plugins.refresh();
// We don't need the APPLET within IE
// ***Please note that if you do not need to script events, you can safely remove the next two lines
document.write("\x3C" + "applet MAYSCRIPT Code=NPDS.npDSEvtObsProxy.class")
document.writeln(" width=5 height=5 name=appObs\x3E \x3C/applet\x3E")
}
//-->
OBJECT ID="MediaPlayer" WIDTH=352 HEIGHT=288
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
STANDBY="Loading Microsoft® Windows® Media Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE=(fx. websrv5.sdu.dk/ta/tv/tv.asx)
<PARAM NAME="AutoSize" VALUE="true">
<PARAM NAME="ShowControls" value="false">
<PARAM NAME="ShowDisplay" VALUE="0">
<PARAM NAME="ShowAudioControls" VALUE="false">
<PARAM NAME="ShowStatusBar" VALUE="false">
<PARAM NAME="Volume" VALUE="-100">
<PARAM name="SAMIFileName" value="undefined">
<Embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
filename= (fx. websrv5.sdu.dk/ta/tv/tv.asx)
src="http://(fx. websrv5.sdu.dk/ta/tv/tv.asx)
Name=NSPlay
ShowControls=0
ShowDisplay=0
ShowStatusBar=0
width=352
height=288>
</embed></OBJECT>