internet.com

Developer Channel

SYMM

Windows Media Basics (8)

Embedding ASF in a Web Page

Embedding with OBJECT
For PC Internet Explorer users, the following HTML addition to your Web page will use the OBJECT method of embedding the clip:

<OBJECT ID="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
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">
<PARAM NAME="FileName" VALUE="yourasffile.asx">
</OBJECT>

If your ASX file is in the same directory as your HTML, relative addressing as shown above in the "VALUE" attribute is the only bit of code you will need to worry about. the rest you can pretty much cut and paste into your HTML. Now that gets you started but you might want to cover for those Netscape users as well.

Embedding for the Plug-In
Windows Media and ASF for Netscape are accessed by way of a plug-in. So we will want to add the following HTML to our prior OBJECT code:

<embed TYPE="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/
contents/wurecommended/s_wufeatured/mediaplayer/default.asp"
SRC="yourasffile.asx"
Name=MediaPlayer
ShowControls=1
ShowDisplay=1
ShowStatusBar=1
width=320 height=290>
</embed>

The various "Show" parameters will reveal the controls the user needs to play the file. Put your own Width and height parameters in to control the size of the player window. As with the OBJECT approach, put you your own file name in for "SRC."


<< Prev 1234567 • 8 • 9 Next >>
 
The Latest WebDev Tips from DevX

Receive news via our XML/RSS feed
XMLRSS



Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers