L-Space Design - Shrinkwrapped and Bespoke Software Development   
 Home Page 
 Customer Login 
 About Us 
 Ask A Question 
 Software Catalog 
 eBooks & Courses 
 DNN Catalog 
 Farewell Package 
 Bespoke Software 
 Useful Links 
 Customer Reviews 
 ClickBank Search 
 Privacy Policy 


Using Microsoft Media Player In A Web Page

By Roger Willcocks

Windows Media Player is perhaps the most common multimedia plugin available for personal computers. It plays a wide variety of file formats, and can easily be embedded into web pages.

Based on the W3C specification, components such as Media Player should be added to a page using the <OBJECT> tag. However, prior to the introduction of this tag, Netscape used the <EMBED> tag, so it is common to nest the two tags so that older Netscape browsers can also render the objects.

Certain attributes are common to all instances of the OBJECT and EMBED tags, and others are required based on what component is being embedded.

The list of required attributes is:

  • Width - Width of object on the screen
  • Height - Height of object on the screen
  • Type - Type of data to be rendered, usually ignored in favour of the MIME type reported by the web server
  • ClassID - The Unique ID that identifies different components. For Media Player this is: clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95
  • CodeBase - The location where the component can be automatically downloaded from if not on the client computer [optional]

Meida player supports a huge range of options, for a full list, see: Microsoft Media Player. Some common ones are:

  • FileName - Path to the media file on the web server
  • AutoStart - Start playing the file without the user pressing start
  • ShowControls - Show the Start/Stop/Fast Forward controls
  • ShowStatusBar - Show the status base
  • ShowDisplay - Show the video area, set to false when using audio files for example.
  • fullScreen - Open the viewer to cover the entire screen instead of running in the defined window
  • windowlessVideo - Only works with new media player versions, lets menus, etc appear in front of the player

All of the properties listed above are true/false (or 0/1) values, except for the FileName. Some other properties may have string or other values.

To construct an embedded media player object, the HTML is like the following example. Each PARAM element must have both a name, and a value.

<OBJECT ID="Player"
  <PARAM name="autoStart" value="True">
  <PARAM name="fileName" value="Files/MyVideo.avi">

This article is shareware.  Give this article away for free on your site, or include it as part of any paid package as long as the entire article is left intact including this notice.
Copyright © 2004 L-Space Design.

Pass this article on to a friend

Friend's First Name

Friend's Email Address




 Home | Login | About | Contact | Catalog | eBooks | DNN Catalog | MJFP | Forums | Bespoke | Links | Reviews | CB Search | Articles
   Valid XHTML 1.0!   Valid CSS!

ASP.NET data compression provided by L-Space Design