Streaming Magazine Column - March 2003
Table of Contents
Chapter Excerpt
Updates
Order the Book
Resources
Tips & Tricks
Streaming Magazine
  Column
Feedback
Author
Home

Authoring: Keep It Simple

Authoring determines how you connect the audience to your streams. You can use a stand-alone ("pop-up") streaming media player, or you can embed streaming media players in web pages. If you decide to embed a player, you can either use the standard playback controls that come with the embedded player or get fancy with custom buttons.

Any customization of embedded players involves using a browser scripting language such as JavaScript or VBscript. Getting fancy has its risks, namely cross-platform and cross-browser issues. We'll look into those next month. For now, let's cover the basics and use the guaranteed method.

The simplest and most bulletproof way to connect an audience to a stream is to play it back in a pop-up player. However, there has to be a mechanism to facilitate the handoff between the browser and the media player. This is what a metafile does.

Metafiles, MIME Types

A metafile contains information about another file. Metafiles often include title, author, and copyright information, and most importantly, the location of the file. The key is that metafiles are delivered with special MIME types that identify them to the browser as belonging to streaming media applications.

A MIME type is a simple text string included in the header of a file. The browser compares this string to its list of registered MIME types, and then hands off the metafile to the appropriate application. After the metafile is handed off, the user is free to resume browsing the Internet. If the browser cannot find a match for the MIME type, it displays an error message (or the too-familiar broken puzzle piece).

Here's how it works:

  1. User clicks on a streaming media link
  2. Browser requests the file; web server returns a metafile
  3. Browser checks the MIME type of the returned file and hands off to streaming media application
  4. Streaming media player opens metafile, determines location of file, and contacts streaming media server
  5. File is pre-buffered and playback begins

Authoring Metafiles

Assuming your audience has the required media player(s) installed and the MIME types have been correctly set, authoring metafiles is simple. QuickTime, RealNetworks, and Windows Media all have simple metafile structures, though the syntax and terminology is slightly different for each.

QuickTime metafiles are called Reference Movies. They can be very powerful, specifying connection speeds or required components for streams. At their most basic, they point to the file. Here's a simple QuickTime metafile:

rtsptext
rtsp://your.quicktimeserver.com/YourStream.mov

Notice how the second line of this file specifies the location of the streaming movie, and the RTSP protocol. RealNetworks metafiles look remarkably similar:

rtsp://your.realserver.com/YourStream.rm

Again, the location of the file is specified, along with the RTSP protocol. You can also include additional information such as title, author and copyright, or start and stop times. Windows Media uses an XML-based language for their metafiles, which are referred to as ASX files:

<asx version="3.0">
	<entry>
	<ref href="mms://your.wmserver.com/YourStream.wmv" />
	</entry>
</asx>

A little more code, but essentially the same information. The tags delimit the entire file; the tags delimit the information about the streaming media file; and the tag contains the actual location of the file. Those of you familiar with HTML will notice the similarity between the tag and HTML's tag. ASX files can also contain a variety of information in addition to the file location.

Typing the above text into a text editor and saving it with the appropriate file extension is the simplest way to create metafiles. QuickTime reference movies take the .qtl or .mov extension; RealNetworks metafiles take the .ram extension, and Windows Media metafiles take the .asx extension. Place the metafiles on your web server, and the streaming files on your streaming media server. When authoring web pages, simply link to the metafile on the web server. The browser should take care of the rest.

Next Month: Authoring - Getting Fancy


Order Now   |    Email   |    Site by Smacktastic/GrDesign   |    All Content ©2002 Streaming Media Bible.com