previous next

Chapter 10: Delivering a Presentation

When you finish building your RealSystem presentation, you place the clips on RealServer for streaming. This chapter explains how to link your Web page to your presentation. It also describes how a Web server can play back some RealSystem presentations.

RTSP and HTTP

To deliver HTML pages and graphics, a Web server uses HyperText Transport Protocol (HTTP), as you can see in Web page URLs that begin with http://. HTTP downloads files without regard to timelines, making clips with timelines more likely to stall. Although RealServer can also use HTTP, URLs for media clips streamed by RealServer begin with rtsp://, which causes it to use RealTime Streaming Protocol (RTSP).

RealServers Stream with RTSP, whereas Web Servers Download with HTTP

Designed specifically for streaming, RTSP enables RealServer to adjust streaming data to keep clips playing smoothly. When two clips play side-by-side, for example, RealPlayer communicates with RealServer about each clip's progress, indicating how much data it needs to keep playback synchronized. RealServer can then adjust the data flow to compensate for changing network conditions, reducing low priority data if necessary to ensure that crucial data gets through. Communication like this is not possible through HTTP.

Which URLs Use Which Protocol

When you assemble a RealSystem presentation, it's important to understand clearly which URLs should use HTTP and which should use RTSP:

Streaming Clips from RealServer

RealServer is the preferred host for RealSystem presentations. Designed specifically to stream multimedia over networks, RealServer keeps multiple clips synchronized and uses many advanced features to ensure that clips stream smoothly, even under adverse network conditions.

When you stream clips from RealServer, the RealServer administrator creates content directories and tells you the basic URLs to use. The administrator can also set up features such as password authentication and pay-per-view. When your media clips and SMIL file are ready, transfer them to RealServer and place them in the directories prepared by the administrator. Then link your Web page to your presentation as described in "Linking Your Web Page to RealServer".

Tip
RealProducer and RealSlideshow can transfer files to RealServer automatically. Refer to their manuals or online help for more information.

With RealServer, you can use Ramgen to launch RealPlayer automatically, eliminating the need to write a separate Ram file. Your Web page URL simply points to your media clip or SMIL file on RealServer and includes a ramgen parameter. The following illustration shows the process of requesting a presentation through Ramgen. This example uses a SMIL file that coordinates multiple clips, but you can also link to a single clip directly without using SMIL.

Requesting a Presentation from RealServer Using Ramgen

  1. Using HTTP, the Web browser requests the SMIL file from RealServer. The URL includes a parameter that invokes Ramgen.

  2. RealServer's response causes the Web browser to launch RealPlayer as a helper application and to give it the URL to the SMIL file.

  3. RealPlayer requests the SMIL file from RealServer using RTSP.

  4. With the information in the SMIL file, RealPlayer requests and receives the streaming media clips.

Linking Your Web Page to RealServer

With your clips on RealServer, link your Web page to the SMIL file by using an HTML hypertext link that looks like the following:


<a href="http://realserver.example.com:8080/ramgen/media/sample.smil">...</a>

If the presentation plays back directly in the Web page through RealPlayer's Netscape plug-in, the URL occurs within an <EMBED> or <OBJECT> tag and looks like this:


SRC="http://realserver.example.com:8080/ramgen/media/sample.smil?embed"

The following table lists and describes the components of these URLs. Contact your RealServer administrator to get the actual RealServer address, HTTP port, and Ramgen directory structure.

URL Components in a Web Page Link to RealServer
URL Component Meaning
http:// This causes the browser to contact RealServer through HTTP. (Web browsers do not use RTSP.)
realserver.example.com This address varies for each RealServer. It typically uses an identifier such as realserver instead of www. It may also use a numeric TCP/IP address, such as 204.71.154.5.
:8080 This is the port RealServer uses for HTTP connections. Separate the port and address with a colon. You can leave the port number out if RealServer uses port 80 for HTTP connections. Include the port number if RealServer uses any port other than 80 for HTTP.
/ramgen/ As "Using Ramgen" explains, this parameter launches RealPlayer without the use of a separate Ram file.
/media/ Following /ramgen/, the URL may list other directories, depending on where the clip resides on RealServer.
sample.smil This is the SMIL file for your presentation. If you have only one clip to stream, you can link directly to that clip instead of to a SMIL file.
?altplay=file.ext This Ramgen option specifies an alternate presentation created for earlier versions of RealPlayer. See "Listing Alternate Presentations with Ramgen".
?embed This Ramgen option embeds the presentation in a Web page. See Chapter 8 for complete information on Web page playback.

Using Ramgen

In your Web page hyperlink, the /ramgen/ parameter shown in the preceding examples causes the Web browser to launch RealPlayer without the use of a separate Ram file. This parameter designates a virtual directory in RealServer, and can be followed in the URL by actual directory listings. If your RealServer does not use Ramgen, you can write a Ram file as explained in "Creating a Ram File Manually". A Ram file also enables you to use some RealPlayer features, such as playing a clip at double or full-screen size.

Listing Alternate Presentations with Ramgen

With altplay, you can use a single link to stream new clips to newer versions of RealPlayer, and to stream older clips to earlier versions of RealPlayer. Suppose that you have a RealVideo 5 clip and a RealVideo 8 clip laid out using SMIL. You link to the SMIL file using Ramgen as described in the preceding section, and you include altplay to list the older clip:


<a href="http://.../ramgen/media/sample.smil?altplay=old_sample.rm">

This link instructs RealServer to point RealPlayer G2 or later to sample.smil. Earlier versions of RealPlayer receive the URL to old_sample.rm. RealServer uses the streaming protocol appropriate for each RealPlayer version, whether RTSP or the older PNA. Note that altplay specifies the clip, not a Ram file. Because of this, the older clip must reside in the same directory as the new content.

Combining Ramgen Options

The question mark operator (?) separates Ramgen options from the main URL. To use multiple Ramgen options, you use a question mark before the first option and separate the remaining options with ampersands (&). The order of options does not matter. For example, the following link uses altplay and embed:


<a href="http://.../ramgen/media/sample.smil?embed&altplay=old_sample.rm">

You can use the ? operator to include earlier Ram file options when using altplay. If your Ram file URL for a RealVideo 5 clip specified an end time, for example, include that option in the Ramgen URL after altplay. The following example shows an end time set for old_sample.rm:


<a href="http://.../ramgen/media/sample.smil?altplay=old_sample.rm&end=7:45">

Playing Clips from a Web Server

If you do not have access to RealServer, you can host your presentation on a Web server. Although not as robust as RealServer streaming, Web server playback provides a reasonable method for sending simple presentations to a small number of users. This type of playback is not recommended for lengthy or complicated presentations, however, or for clips viewed simultaneously by large groups.

A Ram file launches RealPlayer when the presentation plays back from a Web server. You therefore need to write the Ram file (as described in "Creating a Ram File Manually") and place it on the Web server. The following illustration shows the process of requesting a presentation from a Web server. All network activity uses HTTP.

Requesting a Presentation from a Web Server

  1. The Web browser requests the Ram file from the Web server.

  2. The Web server downloads the Ram file to the browser.

  3. The Ram file extension (.ram or .rpm) causes the Web browser to launch RealPlayer. Note that the .ram extension launches RealPlayer as a separate application, whereas the .rpm extension plays the presentation within the Web page.

    Additional Information
    For more information on embedding a presentation in a Web page, see Chapter 8.

  4. RealPlayer receives the Ram file and requests the SMIL file from the Web server. Alternately, the Ram file can simply list either a single clip or multiple clips played in sequence.

  5. With the information in the SMIL file, RealPlayer requests and receives the clips from the Web server.

Limitations on Web Server Playback

Because Web servers are not designed to manage bandwidth or keep multiple clips synchronized, streaming clips delivered by a Web server are more likely to stall than are clips streamed by RealServer. To ensure that a presentation hosted by a Web server plays as smoothly as possible, observe the following points.

No SureStream Clips Encoded for Multiple Bandwidths

A Web server cannot send just one stream from a SureStream clip encoded for several bandwidths. Instead, it downloads the entire clip, causing a very high preroll. You must therefore encode each RealAudio or RealVideo clip for just one bandwidth. When using RealProducer, select the option for Web server playback and choose your target audience. To support multiple bandwidths, encode separate clips for various bandwidths and use SMIL to let RealPlayer choose which clip to play.

Additional Information
For more on using SMIL to list clip choices, see "Setting Bandwidth Choices".

No Secure RealAudio and RealVideo Clips

When you encode RealAudio and RealVideo clips with RealProducer, you have an option to prevent RealPlayer users from recording the streamed clips to their computers. This feature works only when RealServer streams the clips. When a Web server delivers the clips, users still cannot record the clips through RealPlayer, but their Web browsers will cache the clips. Additionally, any user can click on your Web page hypertext links and use Save as... commands to download the clips from the Web server.

Limited Ability to Keep Parallel Clips Synchronized

A Web server does not consider clip timelines when downloading data. Nor does it receive feedback from RealPlayer about the presentation's progress. Web server playback therefore makes it harder for RealPlayer to keep clips synchronized. A presentation that plays large clips in parallel may stall when the RealPlayer connection has little bandwidth to spare.

RealPix Presentations Require Clip Size Information

RealServer determines when to stream each RealPix image based on the image's place in the presentation timeline. Because a Web server cannot do this, you must indicate each image's file size in the RealPix markup. This enables RealPlayer to calculate when to request an image from the Web server so that all image data has arrived by the time the image displays. If the file size information is missing, RealPlayer requests all images when the presentation starts, causing a high preroll.

SMIL File Optional

When delivering a single clip or a few clips played in sequence, you do not need a SMIL file. Instead, you can simply list the clips in order when writing your Ram file, as described in "Creating a Ram File Manually". However, you can also have your Ram file specify a SMIL file that lists the clip locations, creates a layout, times the presentation, and so on.

SMIL Internal Timing Commands Do Not Work

Although you can use SMIL to lay out and time your presentation, you should not use the clip-begin and clip-end attributes. A Web server cannot begin to download a clip at a certain point in its timeline. With clip-begin="5min", for example, RealPlayer must wait until it has received the first 5 minutes of clip data before it can play the clip. This results in an unacceptably long wait.

Additional Information
"Setting Internal Clip Begin and End Times" describes these SMIL commands.

No Ad Insertion

The RealSystem ad insertion feature, described in Chapter 9, does not work with Web servers. Only RealServer can replace <RealAdInsert.../> tags in SMIL files with URLs to ad clips.

No RealPlayer Seeking

Because a Web server cannot jump to a new position in a clip's timeline, the RealPlayer position slider cannot fast-forward the clip. If the user moves the slider forward, playback pauses as the clip continues to download at its normal rate. RealPlayer resumes playback once the clip data reaches the specified timeline position.

No RTSP URLs

Because Web servers do not support RTSP, all URLs in presentations hosted by Web servers should begin with http://. This includes all URLs in a SMIL file or Ram file.

No Live Broadcast

Live broadcast is not possible because Web servers can download only clips that are stored on disk.

Configuring Web Server MIME Types

To download a RealSystem presentation from a Web server, the server must be configured with the MIME types listed in the following table. If you are using an ISP, ask the Web server administrator to configure the MIME types for you.

Web Server MIME Types for RealSystem Files
File Type Extension MIME Type
Ram .ram audio/x-pn-realaudio
Embedded Ram .rpm audio/x-pn-realaudio-plugin
SMIL .smil and .smi application/smil
RealAudio .ra audio/x-pn-realaudio
RealVideo .rm application/x-pn-realmedia
Flash .swf application/x-shockwave-flash
RealPix .rp image/vnd.rn-realpix
RealText .rt text/vnd.rn-realtext

Creating a Ram File Manually

A Ram file is a text file with the extension .ram (.rpm for playback in a Web page). When a browser receives this file, it launches RealPlayer as a helper application. RealPlayer then requests the clips listed in the Ram file. As described in "Using Ramgen". RealServer can launch RealPlayer without using a Ram file. When doing any of the following, however, you may need to write a Ram file:

To create a Ram file:

  1. Open any editor or word processor that can save files as plain text. On the top line, enter the full URL of the SMIL file or the media clip. You may need to verify URLs with your RealServer or Web server administrator. As you can see in the following scenarios, URLs vary with the playback context:

  2. For a presentation played back from RealServer, you can support earlier versions of RealPlayer (such as RealPlayer 4 or 5) just as Ramgen does with the altplay option. To do this, add the marker --stop-- after the RTSP URL and then specify the URL for the older clip just as it appeared in your previous Ram file. Here's an example:
    
    rtsp://realserver.example.com:554/media/sample.smil
    --stop--
    pnm://realserver.example.com:7070/media/old_sample.rm

    The second URL specifies the older RealSystem protocol with pnm:// and designates RealServer's PNA port. When RealPlayer connects, it chooses the URL based on its favored protocol. For this reason, you cannot list two URLS that both use the same protocol, whether rtsp://, pnm://, or http://.

  3. Save the Ram file as plain text with a .ram extension (played in RealPlayer) or a .rpm extension (played in a Web browser).

  4. Move your Ram file to RealServer or your Web server. Even if all your media clips are on RealServer, you can place the Ram file on your Web server. When the browser receives a Ram file, it turns it over to RealPlayer, which uses the URLs in the file to request clips. Hence the Ram file and the media clips do not need to reside on the same computer.

  5. For .ram files, link your Web page to the Ram file by using an HTML hyperlink such as this:
    
    <a href="http://www.example.com/media/sample.ram">click for video</a>
    

    For .rpm files, incorporate the link URL in the <EMBED> or <OBJECT> tag as described in "Setting Basic Parameters". If the Ram file is on RealServer, the URL must not use the ramgen parameter.

Setting a Presentation's Starting Mode

In the Ram file, you can control how RealPlayer initially displays a clip or SMIL presentation. You can play a clip back at double its normal size, for example, or open RealPlayer in its compact mode. To set the starting mode, add one of the following options to the end of the Ram file URL:

?screensize="double" Opens the clip or presentation at double its normal size.
?screensize="full" Starts the clip or presentation in full-screen mode. This hides all windows to make the user's monitor look like a television screen.
?screensize="original" Opens the clip or presentation at its normal size. This is the default behavior if you omit screensize.
?mode="compact" Opens RealPlayer 8 or later in compact mode so that only the basic controls appear. It does not affect earlier versions of RealPlayer.

This example opens a SMIL presentation in full-screen mode:


rtsp://realserver.example.com/media/sample1.smil?screensize="full"

The next example opens a RealVideo clip at double its normal size:


rtsp://realserver.example.com/media/video1.rm?screensize="double"

To include two options in the URL, use a question mark (?) before the first option, and then separate the second option with an ampersand (&). The following example opens a RealVideo clip at double its normal size and sets RealPlayer to its compact mode:


rtsp://realserver.example.com/media/video1.rm?screensize="double"&mode="compact"

Notes on Setting a Starting Clip Size

If you plan to use double or full-screen mode when playing back a clip or presentation, keep the following points in mind:

Adding Comments to a Ram File

You can add a comment to a Ram file by using a pound sign (#) as the first character on a line. The following example shows two lines commented out of a Ram file:


# Two videos and a SMIL presentation
# streamed from RealServer.
rtsp://realserver.example.com/media/video1.rm
rtsp://realserver.example.com/media/video2.rm
rtsp://realserver.example.com/media/sample2.smil

Testing Your Presentation

Use the following guidelines to make sure your presentation works well and reaches its target audience:

Advertising on RealGuide

Every day, thousands of people visit RealGuide, RealNetworks' online guide for streaming media sites and live events (http://realguide.real.com). If you regularly host streaming media presentations of interest to the public, or if you have a live event you want to advertise, you can submit your listing to RealNetworks. Simply complete the following online form to list your site or live event:

In the form, you provide the site or event name, the URL, a short description, and the name of a contact person. A RealGuide staff member then verifies your site or event before including it on RealGuide. (RealNetworks reserves the right to edit or refuse submissions.) For live events, please submit your request at least one business day in advance. If you have questions or need to change a listing, please contact RealGuide from this Web page:

Using RealNetworks Logos

When you create RealSystem content, RealNetworks encourages you to add RealSystem logos to your Web page. You can provide a RealPlayer download link button, for example, so that users can get RealPlayer from RealNetworks' Web site and view your content. You can read RealNetworks' trademark policies and get RealSystem and RealPlayer logos at the following address:

http://www.realnetworks.com/company/guide/index.html


Copyright © 1998-2000 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 12/12/00 at 15:34:14.
previous next