To embed the Windows Media Player control in a Web page that can be displayed by a Firefox browser, create an OBJECT element or an EMBED element that has one of the following mime types as its type attribute:
- application/x-ms-wmp
- application/asx
- video/x-ms-asf-plugin
- application/x-mplayer2
- video/x-ms-asf
- video/x-ms-wm
- audio/x-ms-wma
- audio/x-ms-wax
- video/x-ms-wmv
- video/x-ms-wvx
The preferred mime type is application/x-ms-wmp.
The following examples show how to embed the Player control using an OBJECT element or an EMBED element.
<OBJECT id="Player"
type="application/x-ms-wmp"
width="320" height="320">
<PARAM name="autostart" value="false"/>
</OBJECT>
<EMBED id="Player"
type="application/x-ms-wmp"
width="320" height="320"
autostart="false"/>
The preceeding examples work in Firefox but not in Internet Explorer. To embed the Player control in a Web page that can be displayed by Internet Explorer, you must create an OBJECT element that has a classid attribute set to the class ID of the Windows Media Player control.
The following example shows how to embed the Windows Media Player control in a Web page that can be displayed correctly by both Internet Explorer and Firefox. Script on the page detects the browser type and generates the appropriate OBJECT tag.
<HTML>
<BODY>
<SCRIPT type="text/javascript">
if(-1 != navigator.userAgent.indexOf("MSIE"))
{
document.write('<OBJECT id="Player"');
document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
document.write(' width=300 height=200></OBJECT>');
}
else if(-1 != navigator.userAgent.indexOf("Firefox"))
{
document.write('<OBJECT id="Player"');
document.write(' type="application/x-ms-wmp"');
document.write(' width=300 height=200></OBJECT>');
}
</SCRIPT>
</BODY>
</HTML>
See Also
- Using the Windows Media Player Control with Firefox
Send comments about this topic to Microsoft
Build date: 12/11/2009