A Streaming Media JukeBox - Part II: Netscape: Embedding the Windows Media Player | WebReference

A Streaming Media JukeBox - Part II: Netscape: Embedding the Windows Media Player

A Streaming Media JukeBox - Part II: Netscape

Embedding the Windows Media Player's Plugin

In Column 51, A Streaming Media JukeBox, we showed you two ways to play a streaming media file. The first one is through an external Media Player. If you haven't install it yet on your computer, this link will connect you immediately to the download area:

Get Windows Media Player

To invoke the external Media Player, just place a link to an ASF or ASX file in your Web page. To see a live demo of a streaming media, try this Media Player Introduction. The minimum modem baud rate should be 28.8K. The video stream will look more like still pictures with lower-rate communication link.

The second method to play a streaming media is to embed the Media Player in the Web page as an ActiveX control. Since ActiveX control is unique to the Windows operating system and Internet Explorer, we need a third method to play streaming media with other operating systems and other browsers. The way to do it is by embedding the Media Player's Plugin in your page. When using the above download link, Microsoft server will identify your operating system and will download both the Media Player ActiveX control as well as its Plugin, either or both, whatever is playable on your computer.

The HTML tag that embeds the Media Player's Plugin is the <EMBED> tag. Here is how we use this tag in our jukebox:

<EMBED TYPE="application/x-mplayer2"
   AUTOSTART="-1" ');

Let's examine the components of this tag:

TYPEThe Plugin's name as was downloaded from Microsoft. Should be assigned the string "application/x-mplayer2".
PLUGINSPAGEThe browser will check if you have the proper Plugin, and, if you don't, will change its location to the given URL for downloading it.
IDThe Plugin's object ID. You can assign any string to the Plugin's ID. Used by Internet Explorer for object referencing.
NAMEThe Plugin's object name. You can assign any string to the Plugin's name. Used by Netscape Navigator for object referencing.
DISPLAYSIZESpecifies the relative size of the Plugin on the page. 0 is normal size, 1 is smaller than normal, 2 is larger than normal, 3 is even larger, and so on.
AUTOSIZESpecifies whether to automatically size the Plugin window according to the streaming media display size. 0 is false, non-zero is true.
BGCOLORSpecifies the background color of the streaming media window.
SHOWCONTROLSSpecifies whether to show the streaming media controls below the media window. 0 is false, non-zero is true.
SHOWTRACKERSpecifies whether to display the tracking marker that shows the current status of the player: opening, buffering, displaying, etc.
SHOWDISPLAYSpecifies whether to display the show information portion, including the author name, the clip name, and the copyright information. 0 is false, non-zero is true.
SHOWSTATUSBARSpecifies whether to display the bar showing the pointer along the stream where the player is currently at. 0 is false, non-zero is true.
VIDEOBORDER3DSpecifies whether to display a 3-D border around the player. 0 is false, non-zero is true.
WIDTHSpecifies the width of the player window.
HEIGHTSpecifies the height of the player window.
SRCSpecifies streaming media file. Can be either ASX, ASF, or any other media format.
AUTOSTARTSpecifies whether to start the media automatically upon loading. 0 is false, non-zero is true.
DESIGNTIMESPA specical ID number. Can be ignored.

Being a plugin, the <EMBED> tag is not accompanied with any parameters to be used in JavaScript. All Plugin's characterstics are controlled via its methods, as we'll explain later in this column.


Produced by Yehuda Shiran and Tomer Shiran

Created: November 9, 1999
Revised: November 23, 1999

URL: http://www.webreference.com/js/column52/install.html