Windows Media Player object in both Firefox and Internet Explorer

Windows Media Player object in both Firefox and Internet Explorer

We can create a media player which work well both in IE and netsacpe. It requires a windows media player plugin for firefox. You can install the plugin from Windows Media Plugin for Firefox.

This player can be used for playing audio and / or video.

For IE the object is

<object id=”contentPlayer” classid=”CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6″ width=”320″

height=”240″>
<param name=”URL” value=”‘+url+’” />
<param name=”uiMode” value=”none”>

Note: IE required the object ID. And url is a javascript variable for the location of the video /

audio file

And for Netscape the object is

<object id=”contentPlayer” type=”application/x-ms-wmp” data=”‘+url+’” width=”320″ height=”240″>
<param name=”URL” value=”‘+url+’” />
<param name=”uiMode” value=”none”>

Note: Netscape requires object type as application/x-ms-wmp this will be available from the

plugin mentioned earlier.

We can use additional parameter like
<param name=”autostart” value=”false”> to control the automatic playing of the audio/video.

Control can be create for various player events like play, pause, stop etc as follows

var wmp = document.getElementById(’contentPlayer’);

wmp.controls.play();
wmp.controls.pause();
wmp.controls.stop();
wmp.controls.fastForward();
wmp.controls.fastReverse();
wmp.settings.mute = true;
wmp.settings.volume = 50;
wmp.fullScreen = true;
wmp.URL = ‘./videos/my_video.wmv’;

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.