Get The Newsletter

The latest in business, marketing and technology, delivered to your inbox!

Your Name:

Email Address:

Business Type:

WorkZ Email Marketing

BizTOOLS

WorkZ Sites
Build a web site yourself for Under $30 or have a designer build one for you.

iPrint.com
The leading source of high quality online business card printing, letterhead printing, custom envelope printing, and more.

Embed With Windows Media

By George Grubb

Looking to stream Windows Media files from a Web page?

Blake Lindsay, Playstream's director of professional services, and I can show you a basic method that differs from the procedure recommended by Microsoft.

Microsoft's methods are more complicated and its basic methods are restricted to the PC and Internet Explorer. But they do provide more advanced options, which gives you more control over how your media stream.

The method we outline for you below is simple and allows you to reach the broadest audience.

By using the embed tag, rather than Microsoft's recommended object tag, which only works with ActiveX controls, you can embed media to stream in Netscape browsers and Mac OS.

It's not as difficult as it might seem and you'll still be able to control viewer experience by specifying and controlling certain properties of the Windows Media Player.

The Easy Way

After digitizing your file, download Microsoft's free encoder to compress the media before you upload it to a Windows Media streaming server.

Encode the media file into a .wmv file then upload it.

Next, reference the location of your Windows Media file inside a simple text document ending with the file extension .asx. Save this text document, known as an ASX metafile, to the Web server where your Web pages reside.

Within the HTML of your Web page, the embed tag will be used to call up the Windows Media Player plug-in. The ASX metafile is an attribute of the embed tag, directing the browser to load the Windows Media player and stream your encoded media file.

The ASX file need not be located in the same directory as the Web page that refers to it, but double check that you've specified the file path correctly if it does not.

For example, let's assume you've digitized your media and they reside on your computer in a file called MyMedia.avi.

Let's encode that file with Microsoft's Windows Media Encoder. A new file will be created called MyMedia.wmv.

Upload this file onto the Windows Media Server.

Next, create a simple text document and name it MyMedia.asx.

Open this document and type in the URL of MyMedia.wmv.

The URL should start with Microsoft's streaming protocol "mms" and look something like the following, where "win.playstream.com" is the name of the Windows Media server to which you uploaded your media file:

<ASX Version="3.0">
<ENTRY>
<REF href="mms://win.playstream.com/MyMedia.wmv"/>
</ENTRY>
</ASX>

Save and close this document.

Upload it to the Web server where your Web pages are stored.

You are now ready to embed your Windows Media clip so it will play inside your Web page.

Here's the HTML to use:

<HTML>
<HEAD>
<TITLE>Embedded Windows Media Player</TITLE>
</HEAD>
<BODY>
<p><EMBED TYPE="application/x-mplayer2"
SRC="MyMedia.asx"
WIDTH="320"
HEIGHT="240"
AUTOSTART="1"
SHOWCONTROLS="0">
</EMBED></p>
</BODY>
</HTML>

We inserted an autostart feature so the embedded clip will play automatically when a viewer arrives at the Web page.

We then hid the Windows Media Player controls by setting showcontrols to 0, which gives us more control over how the viewer experiences playback. Had we typed a 1 instead of a 0 (1 = true, 0 = false) the Windows Media Player controls would be available on the Web page.

You must specify the height and width of your clip, so make sure you know these attributes.

Or the Hard Way

If you want greater control over your streaming media, it's worth taking the extra time to learn Microsoft's method. It is definitely more complex and offers unique capabilities beyond the scope of this article. Some of these more advanced methods involve the use of VBScript, a Microsoft development language.

To learn more, visit the Windows Media product page.

For developers and content producers, we recommend visiting Windows Media Web Workshop, which is part of MSDN online.

Also, Microsoft TechNet provides valuable information and offers explicit instructions on embedding your Windows Media on Web Pages.


About the Author:
George Grubb is CEO and founder of PlayStream, a streaming media service company.

Click here for more info from this author...