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 G2 presentations.
A RealSystem presentation served by RealServer G2 involves the HTTP and RTSP protocols. If you have experience creating Web pages, you know that HTTP is the standard protocol Web browsers and Web servers use to communicate. Most Web page URLs begin with http:// to make the file download use the HTTP protocol.
As explained in "Hosting a Presentation on a Server", RealServer G2 and RealPlayer G2 communicate primarily with RTSP, a new protocol designed specifically for streaming media. When you assemble a RealSystem presentation, it's important to understand clearly which URLs should begin with http:// and which should begin with rtsp://.
Use rtsp:// in URLs in which RealPlayer G2 requests clips from RealServer G2. These URLs occur in SMIL files (.smil) and Ram files (.ram or .rpm). Use http:// in these URLs only if the clips are stored on a Web server instead of RealServer. Because a Web server doesn't use RTSP, you can't have rtsp:// in a URL to a clip stored on a Web server.
Links to a Web server or RealServer within a Web page (.htm or .html) always start with http://. Like Web servers, Web browsers don't use RTSP and can't interpret streaming information sent by RealPlayer over RTSP. The Web browser can connect to RealServer through HTTP, though, because RealServer G2 can transmit data with HTTP or RTSP.
|
|
Additional Information |
|---|
| For more on SMIL file URLs, see "Linking to Clips on RealServer" and "Linking to Clips on a Web Server". See also "URL Reference". |
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 below.
|
|
Tip |
|---|
| Because earlier versions of RealServer do not support SMIL and RTSP, ensure that RealServer G2 hosts your presentation. Also note that RealNetworks production tools can transfer files to RealServer automatically. See http://www.realnetworks.com/developers/ for details. |
When you use RealServer, the Ramgen feature can automatically launch RealPlayer, 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 next figure illustrates 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 with an HTML hypertext link that looks like this:
<a href="http://realserver.company.com:8080/ramgen/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.company.com:8080/ramgen/sample.smil?embed"
The following table explains 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 makes the browser contact RealServer through the HTTP protocol. (Web browsers do not use RTSP.) |
realserver.company.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 besides 80 for HTTP. |
/ramgen/ |
As "Using Ramgen" explains, this parameter launches RealPlayer without the use of a separate Ram file. |
sample.smil |
This is the SMIL file for your presentation. If you have just one clip to stream, you can link directly to that clip instead of a SMIL file. |
?altplay=file.ext |
This Ramgen option specifies an alternate presentation created for older versions of RealPlayer. See "Listing Alternate Presentations". |
?embed |
This Ramgen option embeds the presentation in a Web page. See Chapter 8 for full information on Web page playback. |
In your Web page hyperlink, the /ramgen/ parameter causes the Web browser to launch RealPlayer without the use of a separate Ram file. This parameter designates a virtual directory on RealServer. It may be followed in the URL by actual directory listings, as in this example:
<a href="http://realserver.company.com:8080/ramgen/media/sample.smil">..</a>
You should use Ramgen even when linking to a single clip, such as a RealVideo (.rm) clip, that automatically launches RealPlayer. If you cannot use Ramgen, you can write the Ram file as described in "Creating a Ram File Manually".
When you update content for RealSystem G2, you can keep existing content available for earlier versions of RealPlayer. Suppose you have a RealVideo 5.0 clip that you want to encode with a RealSystem G2 codec and lay out with SMIL. After re-encoding the source file with the new codec and writing the SMIL file, you change the link to the 5.0 Ram file to point to the SMIL file, using the Ramgen altplay option to list the older clip as an alternate:
<a href="http://.../ramgen/sample.smil?altplay=old_sample.rm">
This link instructs RealServer to point RealPlayer G2 to sample.smil. Earlier versions of RealPlayer receive the URL to the older old_sample.rm file. Note that the URL specifies the actual clip, not the old Ram file. The older clip must reside in the same directory as the new clip or SMIL file.
|
|
Tip |
|---|
It is not necessary to keep older content available. If you
do not use altplay, page visitors using older versions of
RealPlayer are prompted to upgrade when they click the
link to the SMIL file.
|
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, then 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/sample.smil?embed&altplay=old_sample.rm">
You can use the question mark operator to include earlier Ram file options when using altplay. If your Ram file URL for a RealVideo 5.0 presentation specified an end time, for example, include that option in the Ramgen URL after altplay. The following shows an end time set for old_sample.rm:
<a href="http://.../ramgen/sample.smil?altplay=old_sample.rm&end=7:45">
If you do not have access to RealServer G2, 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. It is not recommended for lengthy or complicated presentations, however, or for clips viewed simultaneously by large groups.
As described in "Launching a Presentation", 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 figure illustrates the process of requesting a presentation from a Web server. All network actions use the HTTP protocol.
|
|
Additional Information |
|---|
| For more information on embedding a presentation in a Web page, see Chapter 8. |
As noted in "Hosting a Presentation on a Server", a presentation downloaded from a Web server is more likely to stall than a presentation 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 stream just one encoding from a SureStream clip encoded for multiple bandwidths. Instead, it downloads the entire clip file, causing an unacceptably high preroll. So you must encode each clip for just one bandwidth. To support multiple bandwidths, encode separate clips for various bandwidths and use SMIL to let RealPlayer choose which clip to play.
|
|
Additional Information |
|---|
| See "Choosing RealAudio Codecs" for information on RealAudio and SureStream. For more on using SMIL to list clip choices, read "Setting Bandwidth Choices". |
A Web server does not consider clip timelines when downloading data and does not receive feedback from RealPlayer. Web server playback therefore makes it harder for RealPlayer to keep clips synchronized. A presentation that plays clips in parallel may begin to stall and rebuffer data when the RealPlayer connection has little bandwidth to spare.
For this reason, it may be difficult to deliver Flash with RealSystem G2, which consists of synchronized animation and audio. You can, however, combine a large clip such as RealVideo with smaller clips, such as image clips or a RealText clip. Because RealText consumes little bandwidth, a Web server can download it to RealPlayer quickly without interfering with other clips.
When delivered by RealServer, images in a RealPix presentation stream at different times depending on their place in the RealPix timeline. This lets you structure a RealPix presentation to keep it flowing smoothly. When delivered by a Web server, however, all RealPix images begin to download as soon as presentation playback begins. This causes a higher preroll.
|
|
Additional Information |
|---|
| RealPix Authoring Guide explains bandwidth usage when RealServer G2 streams RealPix. This guide is available at http://service.real.com/help/library/index.html. |
When delivering a single clip or a few clips played in sequence, you do not need a SMIL file. You can simply list the clips in order when writing your Ram file as described in "Creating a Ram File Manually". You can, however, 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. If you specify clip-begin="5min", for example, RealPlayer must wait until it has received the first five minutes of clip data before it can begin to play the clip back. This creates an unacceptably long wait.
|
|
Additional Information |
|---|
| "Setting Internal Clip Begin and End Times" describes these SMIL commands. |
Because a Web server cannot jump to a new position in a clip 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 requested timeline position.
Because Web servers do not support the RTSP protocol, all URLs in presentations hosted by a Web server 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 stored on disk.
To download a RealSystem presentation from a Web server, the server must be configured with the following MIME types. If you are using an ISP, ask the ISP's Web server administrator to configure the MIME types listed in the following table.
Whenever possible, launch RealPlayer automatically with RealServer's Ramgen feature as described in "Using Ramgen". In some cases, though, you may need to write a Ram file:
The following example links to a SMIL file on a RealServer machine that does not use Ramgen:
rtsp://realserver.company.com/media/sample1.smil
To deliver a few clips or SMIL files in sequence, list the URLs in their playback order:
rtsp://realserver.company.com/media/sample1.smil
rtsp://realserver.company.com/media/video1.rm
rtsp://realserver.company.com/media/sample2.smil
For Web server playback, you specify the HTTP protocol and the Web server name, along with the SMIL file or media clip:
http://www.company.com/media/video1.rm
To deliver a few clips or SMIL files in sequence, list the URLs in their playback order:
http://www.company.com/media/video1.rm
http://www.company.com/media/video2.rm
http://www.company.com/media/sample1.smil
For local playback of clips residing on the user's machine, start the URL with file:// and list clips in their locations relative to the Ram file. For example, the following specifies a clip that resides one level below the Ram file in the media directory:
file://media/video1.rm
To deliver a few clips or SMIL files in sequence, list the URLs in their playback order:
file://media/video1.rm
file://media/video2.rm
file://media/sample1.smil
|
|
Additional Information |
|---|
| These local URLs are like those used in a SMIL file to locate media clips. For more information on general URL syntax, see "Specifying Clip Locations". |
altplay option. To do this, add the marker --stop-- after the RTSP URL. Then specify the URL for the older clip just as it appeared in your previous Ram file. Here's an example:
rtsp://realserver.company.com:554/sample.smil
--stop--
pnm://realserver.company.com:7070/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 with an HTML hyperlink such as this:
<a href="http://www.company.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.
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 G2.
rtsp://realserver.company.com/media/video1.rm
rtsp://realserver.company.com/media/video2.rm
rtsp://realserver.company.com/media/sample2.smil
The Presets menu for RealPlayer G2 lets you save URLs, much like a Web browser lets you set bookmarks or favorites. If you want to share Presets with your users, you can post on your Web page a Presets Pack that users can download and import into their RealPlayers.
|
|
Tip |
|---|
| Use Presets>Organize Presets to move existing Presets into your Presets Pack folder. You can move them back after you have exported the Presets Pack. |
<a href="http://www.company.com/presets.prx">My Favorite Presets</a>
Depending on the browser used, the download may import the Presets Pack into RealPlayer automatically. Otherwise users can import it with one of these methods:
|
|
Note |
|---|
| Imported Presets will not overwrite existing Presets that have the same Title or Category. See the Sharing Presets topic in RealPlayer's online help for details. |
The following are guidelines for making sure your presentation works well and reaches its target audience:
|
|
Additional Information |
|---|
| "What is Preroll?". |
|
|
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, for example, it uses complex Flash animation or high- bandwidth video, 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 RealAudio or RealVideo content of interest to the public, or you have a live event you want to advertise, you can submit your listing to RealNetworks. Simply complete an online form to list your site:
In the form, you give the site or event name, URL, short description, and contact person. A staff member then verifies your site or event before including it on RealGuide. (RealNetworks reserves the right to refuse or edit 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 e-mail timecast@timecast.com.