Using an embedded Windows Media Player to Display Movie in the Window Media Player

 

 

When your movie is uploaded into your file manager you can use the web address and place it into the src="link.asx"

 

Example

 

src=" http://www.tqnyc.org/NYC051339/Oedipus_0002.wmv"

 

Another tip is that you can change the size of the width="320" height="240"

 

Example

 

width="450" height="370"

 

 

 

How to embed Windows Media Player into a HTML page

 

This option gives you the format to insert into the HTML page code if you don’t want to create it from the Active X controls in Dreamweaver.

 

We will now look at a sample of code used to embed windows media player into a HTML page. The code is as follows:

 

Text Box:  
<OBJECT 
ID="WMPlay" width="320" height="240" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
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">
//NOTE: the above lines should be joined as a single line; they have been split here for formatting purposes
 
<PARAM NAME="URL" VALUE="link.asx">
<PARAM NAME=ShowControls VALUE=1>
<PARAM NAME=ShowDisplay VALUE=0>
<PARAM NAME=ShowStatusBar VALUE=0>
<PARAM NAME=AutoStart VALUE=TRUE>
 
<EMBED 
width="320" height="240" type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" 
src="link.asx" Name="WMPlay" ShowControls="1" AutoStart="True" 
ShowDisplay="0" ShowStatusBar="0">
//NOTE: the above lines should be joined as a single line; they have been split here for formatting purposes
</EMBED>
</OBJECT>
 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Explanation

 

 The OBJECT tag embeds ActiveX controls within the HTML page and this tag is recognised by most browsers. Its components are;

     

 

ATTRIBUTE

VALUE

ID

This can be any string constant you wish to.

WIDTH, HEIGHT

Determines the size of the video clip.

CLASSID

This code is used to determine whether the appropriate plug-in is installed and registered on the user’s machine. Needs to be copied and pasted as is.

CODEBASE

The directory containing the object class file and any resources needed by the object. This attribute is synonymous with the PLUGINSPAGE attribute of the EMBED tag (see following section). Needs to be copied and pasted as is.

STANDBY

Message to be displayed while the Media Player is loading.

TYPE

ActiveX control type specification. Needs to be copied and pasted as is.

The various parameters which can be defined for the embedded OBJECT are;

 

PARAMETER NAME

VALUE

URL

Specifies the link to the ASX file (which will be stored in the same directory as the HTML files).

ShowControls

Boolean: 1 is used to denote ‘true’ whereas 0 for ‘false’. E.g. in the sample code; ShowControls is true (i.e. the controls will be displayed).

ShowDisplay

Boolean (true or false): Specifies whether or not clip information should be displayed.

ShowStatusBar

Boolean: Defines if the status bar should be displayed.

AutoStart

Boolean value that determines if the clip should begin to play automatically once loaded.

 

The EMBED tag has to be included so that the embedded object can be recognised by Netscape browsers. The attributes defined in this tag are;

ATTRIBUTE

VALUE

WIDTH, HEIGHT

Define the size of the video clip window.

TYPE

Specifies the MIME type of the object.

PLUGINSPAGE

Specifies the URL from which the required plug-in can be downloaded if not already installed.

SRC

URL of the ASX file (which will be stored in the same directory as the HTML files).

NAME

Specifies the name of the plug-in.

 

 

Inserting a Windows Media Player in a web page

Users often express interest in playing video files on their Web pages. This TechNote shows how to embed the Microsoft Windows Media Player in an HTML page to play a video file. The embedded Windows Media Player will display most video file formats in recent versions of both Microsoft Internet Explorer and Netscape on the Windows platform, although whether the video files display as expected will depend on several factors, including specific configurations on the computers viewing the video files.

You should be comfortable with hand-modifying source code (and this may involve changing certain parameters) before implementing these steps.

Adding your own ActiveX parameters in Dreamweaver

  1. In the Document window, place the insertion point where you want the Windows Media Player to appear.
  2. Choose Insert > Media > ActiveX. The menu commands used may differ slightly depending on the version of Dreamweaver used. This will add an empty ActiveX object to the page.
  3. Select the ActiveX object in the Document window.
  4. On the Property inspector, enter the following text into the Class ID text box:

    CLASSID:CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6

    You can copy the above text from this web page and then paste it into the Class ID text box. Although this is a pop-up menu from which you can choose various class IDs, you can also freely add any class ID you might need.
  5. Also on the Property inspector, do the following:
    1. Select Embed.
    2. Set the width and height in the W and H text boxes. A standard setting is 320 x 290 pixels.
    3. Click the Browse folder icon (next to the Src text box) and navigate to find and select a file in a supported Media Player format. (Supported formats are listed in the chart below.)
    4. Type mediaplayer1 in the ID text box.
  6. Click Parameters on the Property inspector.
  7. In the Parameters dialog box, enter the following parameters:

Parameter

Value

FileName

YourFileNameHere (same as the Src path in Step 5)

AutoStart

True

ShowControls

True

ShowStatusBar

False

ShowDisplay

False

AutoRewind

True


  1. You add a parameter by clicking Plus (+). The above parameters are those most commonly chosen. You may want to change these to suit your needs. For instance, if you would prefer that the video not play until the viewer clicks Play, set the AutoStart parameter to False instead of True.
  2. Switch to Code view or open the Code Inspector. Your HTML code will now look similar to that displayed below:
10.       <object width="320" height="290" 
11.       classid="CLASSID:CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
12.       id="mediaplayer1">
13.       <param name="Filename" value="kids.mpg">
14.       <param name="AutoStart" value="True">
15.       <param name="ShowControls" value="True">
16.       <param name="ShowStatusBar" value="False">
17.       <param name="ShowDisplay" value="False">
18.       <param name="AutoRewind" value="True">
19.       <embed width="320" height="290" src="/support/dreamweaver/ts/documents/kids.mpg"
20.       filename="kids.mpg" autostart="True" 
21.       showcontrols="True" showstatusbar="False" 
22.       showdisplay="False" autorewind="True">
23.       </embed> 
24.       </object>
  1. In the source code add the following text inside the <embed> tag:
26.       type="application/x-mplayer2"
27.       pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"

Your source code should now appear similar to:

<object width="320" height="290" 
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" 
id="mediaplayer1">
<param name="Filename" value="kids.mpg">
<param name="AutoStart" value="True">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="False">
<param name="AutoRewind" value="True">
<embed 
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="320" height="290" src="/support/dreamweaver/ts/documents/kids.mpg"
filename="kids.mpg" autostart="True" 
showcontrols="True" showstatusbar="False" 
showdisplay="False" autorewind="True">
</embed> 
</object>
  1. Save the file and test on different systems and in different browsers.

View a demonstration of these steps.

See Example 1 for a demonstration of an embedded Windows Media Player playing a MPG video file. This file will play best in Internet Explorer; Netscape users may experience unpredictable results. In particular, Netscape must have the Windows Media Play plug-in (Npdsplay.dll) for the file to play.

Supported media formats and browsers

Media formats supported by Windows Media Player

Supported Media Formats

Windows

Microsoft Windows Media formats

 

.avi, .asf, .asx, .rmi, .wav, .wma, .wax

Moving Pictures Experts Group (MPEG)

 

.mpg, .mpeg, .m1v, .mp2, .mp3, .mpa, .mpe

Musical Instrument Digital Interface (MIDI)

 

.mid, .rmi

Apple QuickTime®, Macintosh® AIFF Resource

 

.qt, .aif, .aifc, .aiff, .mov

UNIX formats

 

.au, .snd

 

Supported Browsers

Supported browsers

Windows

Internet Explorer 4.x

Internet Explorer 5.x

Netscape 4.x

Nescape 6

Note: Again, how different video files will play in an embedded Windows Media Player can be unpredictable in different browsers and on different systems. You will want to test your pages on different systems to be sure you are getting the consistent results that you anticipate. Some file formats, such as some AVI files, may display on both Windows and Macintosh (QuickTime will probably display the video files on the Macintosh). Some AVI files, however, may play in QuickTime on both platforms but not in Windows Media Player.

 

 

Bibliography

 

http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_15777