Chapter 1: Synopsis and Basics
Chapter 2: Production
Chapter 3: RealMedia
Chapter 4: Windows Media
Code and Examples: Embedding
Code and Examples: Scripting and PlugIn Detection
Code and Examples: ASX
Chapter 5: QuickTime
Chapter 6: Further Solutions
About the author...
Click here for information
Back to start page.





 

Chapter 4: Windows Media: Embedding


Example 1 - Simple cross-browser embedding
Example 2 - Cross-browser embedding with player controls


Links: Windows Meddia Player Embedding

Open this link.

MSDN: Embedding the Player Control in a Web Page
MSDN article about embedding the player into a webpage, with some information about scripting. Go



Example 1 - Simple cross-browser embedding

This is a simple example for an embedded Windows Media Player. Here the EMBED Tag was ”nested” into the OBJECT Tag. As we have seen in the book Internet Explorer uses the OBJECT Tags to embedd an ActiveX control with a given ID into a HTML page. Although proprietary, the concept of ActiveX controls gives programmers much more flexibility than Netscape’s plug-in model. For example, you can integrate functions of Windows Media Player, Encoder and Services in websites using ActiveX controls.

The source code below just embedds a Windows Media ImageWindow without any controls, buttons or info panels.

Source code:

<OBJECT ID="MediaPlayer1" width=320 height=240
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/
en/nsmp2inf.cab#Version=6,4,5,715"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM NAME="FileName" VALUE="mms://www.streaming-media.info/media/wm_demo.wmv">
<PARAM NAME="ShowControls" VALUE="False">
<PARAM NAME="ShowStatusBar" VALUE="False">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
SRC="mms://www.streaming-media.info/media/wm_demo.wmv"
name="MediaPlayer1"
width=320
height=240
autostart=1
showcontrols=0>
</EMBED>
</OBJECT>

See it in action.

Back to top of page.


Example 2 - Cross-browser embedding with player control bar

Like in example 1 a Windows MEdia Player is embedded into the HTML page. Additionally Windows Media Player’s controls, statusbar and metadata display are activated.

Source code:

<OBJECT ID="MediaPlayer1" width=320 height=380
classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/
en/nsmp2inf.cab#Version=6,4,5,715"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM NAME="FileName" VALUE="mms://www.streaming-media.info/media/wm_demo.wmv">
<PARAM NAME="ShowControls" VALUE="True">
<PARAM NAME="ShowStatusBar" VALUE="True">
<PARAM NAME="ShowDisplay" VALUE="True">
<EMBED type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
SRC="mms://www.streaming-media.info/media/wm_demo.wmv"
name="MediaPlayer1"
width=320
height=380
autostart=1
showcontrols=1
showstatusbar=1
showdisplay=1>
</EMBED>
</OBJECT>

See it in action.

     
Synopsis and Basics  Production  RealMedia  Windows Media  QuickTime
Further Solutions  About the author
Any bugs, problems or comments? Please send a mail.
Copyright © 2003 Tobias Künkel.