Using
an embedded Windows 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:

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 |
|
|
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. |
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.
mediaplayer1 in the ID text box. |
Parameter |
Value |
|
FileName |
YourFileNameHere (same as the Src path in Step 5) |
|
AutoStart |
True |
|
ShowControls |
True |
|
ShowStatusBar |
False |
|
ShowDisplay |
False |
|
AutoRewind |
True |
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>
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>
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.
|
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 ( |
|
|
.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