After Hours

Embed streaming media online

There are several ways that you can embed streaming media files on your Web site. Here's how.

By Joseph T. Sinclair

Have RealProducer create a Web page for you automatically. You can then use that page as a basis for creating your own. Use the HTML <embed> markup for Netscape browsers and the <object> markup for Microsoft Internet Explorer to place RealMedia content in a Web page.

Once you've set up your Web page, RealProducer can automatically upload both the page and the raw media RAM file with the .ram extension to your Web site. You will also need a separate RAM file with the .rpm extension to request the .ram files from your Web server or RealServer and allow them to play in a Web browser. Parameters inside the <embed> and <object> markups refer to the .rpm file, an ASCII file that contains the URL of the streaming media file. RealProducer can automatically create this .rpm file for you.

You can elect to display the RealMedia file with a variety of user controls. Alternatively, you can make RealMedia's presence invisible and play audio files automatically when a user enters your Web site.

For QuickTime content, use the <embed> markup for both Microsoft and Netscape browsers.

Integrating diverse media

Although sound and video are of primary interest, both RealNetworks and QuickTime will handle a variety of media, from streaming text to normal graphics (images) or even MIDI music.

The best way to use and coordinate diverse media is SMIL (Synchronized Multimedia Integration Language). SMIL is an open Web standard that plays either in the RealPlayer or in a Web page and thus lets you make compelling multimedia presentations without using CGI scripts, JavaScript, or Java. RealNetworks extends SMIL with the proprietary HTML extensions RealPix and RealText. RealPix creates fades, wipes, and other images. RealText creates moving text effects, such as tickertapes and scrolls. RealProducer Pro includes a collection of SMIL templates, but it's limited as a SMIL authoring program. On the other hand, Sausage Software's SMIL Composer is a useful authoring program, and it's free.

QuickTime has a built-in capability to handle diverse media on a timeline and includes functions similar to those of SMIL, RealPix, and RealText. QuickTime has one advantage over SMIL in that many general multimedia authoring programs, such as Macromedia Director, can export a QuickTime movie version of a multimedia presentation. Until version 4.0, QuickTime did not stream; the current version, 4.1, will not only stream but will even import SMIL presentations.

QuickTime uses data structures called tracks to represent single data streams. Each track has a corresponding media and is independent of all the other tracks. These tracks can play simultaneously or in sequence. Think of a QuickTime movie as a container for the tracks of medium you employ in a multimedia presentation.

QuickTime Pro is the authoring program for both Mac and Windows that enables you to create a streaming presentation with tracks. Other, more robust, QuickTime authoring programs are available, too.

Delivering streaming media

Web servers can handle both RealMedia and QuickTime files via HTTP, but Web servers were not designed to handle streaming media efficiently. Streaming media requires a constant flow of packets and ties up a server for long periods of time, almost like a dedicated connection. If too many visitors hit a site, the Web server slows down.

In response to this problem, RealNetworks has helped establish an open Web standard for streaming media: RTSP (Real Time Streaming Protocol). It requires a special server, called a RealServer, but RTSP increases the quality, efficiency, and traffic-handling capabilities of a streaming media operation. If your ISP has a RealServer, use the RealServer in preference to the Web server. Just store your RealMedia files in their own directory on your ISP's hard disk. If you have high RealMedia traffic and you use a Web server, you'll need to find an ISP with a RealServer.

RealNetworks offers a free RealServer that can handle up to 20 concurrent users, enough for light use. However, the license doesn't permit use by ISPs. RealServers that can handle a higher level of traffic also come at a higher price.

QuickTime offers the QuickTime Streaming Server, which uses several special protocols, including RTSP. It is actually part of the Mac OS X Server.

Joseph T. Sinclair developed the first gourmet food store on the Web in 1994 using Web database technology. He has written seven books about the Web.

Editor's Picks