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.
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).
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.
When you assemble a RealSystem presentation, it's important to understand clearly which URLs should use HTTP and which should use RTSP:
Use rtsp://
in URLs in which RealPlayer requests clips from RealServer. These URLs occur in SMIL files (.smil) and Ram files (.ram or .rpm).
Use http://
in SMIL and Ram file URLs only if the clips are stored on a Web server instead of on RealServer. Because a Web server does not use RTSP, you cannot use rtsp://
in a URL to a clip stored on a Web server.
Web page links to a Web server or RealServer always start with http://
. Web browsers cannot interpret streaming information sent by RealServer through RTSP. The Web browser can connect to RealServer through HTTP, though, because RealServer also uses HTTP.
![]() |
Additional Information |
---|
For more on SMIL file URLs, see "Specifying Clip Locations". "URL Reference" will help you remember when to use RTSP URLs vs. HTTP URLs. |
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.
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 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. |
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.
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.
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"
>
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.
![]() |
Additional Information |
---|
For more information on embedding a presentation in a Web page, see Chapter 8. |
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.
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". |
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.
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.
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.
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.
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. |
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.
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.
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.
Live broadcast is not possible because Web servers can download only clips that are stored on disk.
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.
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:
The following example links to a SMIL file on a RealServer that does not use Ramgen:
rtsp://realserver.example.com/media/sample1.smil
To deliver a few clips (but not SMIL files) in sequence, list the URLs in their playback order as shown here:
rtsp://realserver.example.com/media/video1.rm
rtsp://realserver.example.com/media/video2.rm
rtsp://realserver.example.com/media/video3.rm
For Web server playback, you specify HTTP and the Web server name, along with the SMIL file or media clip:
http://www.example.com/media/video1.rm
To deliver a few clips (but not SMIL files) in sequence, list the URLs in their playback order:
http://www.example.com/media/video1.rm
http://www.example.com/media/video2.rm
http://www.example.com/media/video3.rm
For local playback of clips residing on the user's computer, start the URL with file://
and list clips in their locations relative to the Ram file. For instance, the following example specifies a clip that resides one level below the Ram file in the media directory:
file://media/video1.rm
To deliver a few clips (but not SMIL files) in sequence, list the URLs in their playback order:
file://media/video1.rm
file://media/video2.rm
file://media/video3.rm
![]() |
Additional Information |
---|
For more information on general URL syntax, see "Specifying Clip Locations". |
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://
.
.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.
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:
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"
If you plan to use double or full-screen mode when playing back a clip or presentation, keep the following points in mind:
screensize="full"
with mode="compact"
.
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
Use the following guidelines to make sure your presentation works well and reaches its target audience:
![]() |
Additional Information |
---|
"Buffering". |
![]() |
Tip |
---|
If clips introduced during a presentation in progress require too much buffering, see "Smoothing Transitions Between Clips". |
![]() |
Tip |
---|
If your presentation is CPU-intensive because it uses complex Flash animation or high-bandwidth video, for example, note this in your Web page. |
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:
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