The Ram file is the basic means for launching a clip or a simple sequence of clips that plays in RealOne Player. You can also use the Ram file to open an HTML page in the media browser or related info pane. This chapter explains the Ram file syntax, covers the URLs to use with streaming clips, and shows you how to pass basic parameters to RealOne Player.
When your presentation is ready to stream, you write a Ram file, which is so-
named because it uses the file extension .ram, as in my_presentation.ram. Also
known as a metafile, the Ram file links your Web page to your clip. Your Web
page links to the Ram file with a standard <a href> tag, and your Ram file
contains the full URL to your streaming presentation. So instead of linking
directly to your clip, your Web page links to the Ram file, which, in turn, links
to the clip.
The Ram file may seem like an unnecessary middle step, but it's important for the following reasons:
The file extension .ram causes a Web browser to launch RealOne Player to play the presentation. RealOne Player might not launch when you link directly to a clip. When you link your Web page directly to a Flash Player file (extension .swf), for example, the browser launches Macromedia's Flash Player. If you intend to stream your Flash clip, you need to use a Ram file to launch RealOne Player instead.
Clips on Helix Universal Server stream over the RTSP protocol, rather than HTTP. This means that the URL used to request the clips must start with rtsp:// rather than with http://. Because browsers cannot make RTSP requests, you link your Web page to a Ram file with an HTTP URL. The Ram file then gives RealOne Player the RTSP URL to your presentation.
Through these parameters, you can specify the HTML page or pages you want to display in RealOne Player's HTML panes as the clip plays.
The only time you shouldn't use a Ram file to launch RealOne Player is when you're using the Ramgen feature of Helix Universal Server, which lets you link your Web page directly to a streaming media clip. Even though your Web page link uses HTTP, the clip will stream to RealOne Player using RTSP. Ramgen doesn't offer all of the features of a Ram file, but it provides a simple way to link clips directly to your Web page.
| For More Information: For more information about using Ramgen, see the presentation delivery chapter of RealNetworks Production Guide. Your Helix Universal Server Administration Guide explains how to set up Ramgen. |
The most basic Ram file has only one line: the full URL to a clip. You can write a Ram file with any text editor, word processor, or HTML editor that can save output as plain text. On Windows, you can use Notepad. On the Macintosh, Simple Text will work fine.
| To write a Ram file: |
| Helix Universal Server: | rtsp://helixserver.example.com/my_video.rm |
| Web server: | http://www.example.com/my_video.rm |
| local: | file://my_video.rm |
| For More Information: For more about URLs, see "What URLs Do You Use?". |
| Tip: Don't use spaces in clip file names or the Ram file name. Although many servers can stream files that include spaces in their names, excluding spaces can help prevent problems during streaming. |
rtsp://helixserver.example.com/video1.rm |
| Warning! Press Enter only to create a new line on which you want to enter a new URL. Do not press Enter when typing in a long URL. It's OK if your text editor wraps the URL to a new line automatically, though. Only a line break you enter yourself will cause an error. |
Windows text editors such as Notepad automatically apply the .txt extension to files. To avoid this, choose "All Files" as the file type in the File>Save As dialog. To edit your Ram file later, you must first open the text editor, then use the editor's Open command to open the Ram file because double-clicking the file launches RealOne Player
Tip:
If your file is saved with a .txt extension, you can remove
the extension or change it to .ram on your computer desktop.
|
Although the Ram file is simple to write, it's often the source of the biggest problem people face with streaming: using an incorrect URL. There are two important things to keep in mind when writing a Ram file:
http:// |
rtsp:// |
file:// |
To deliver HTML pages and graphics, a Web server uses Hyper Text Transport Protocol (HTTP), which downloads files without regard to timelines, making clips with timelines more likely to stall. Although Helix Universal Server can also use HTTP, it generally uses Real-Time Streaming Protocol (RTSP) to deliver streaming clips. RTSP is an Internet standard set forth by the Internet Engineering Task Force (http://www.ietf.org/).
Designed for streaming, RTSP enables Helix Universal Server to keep clips playing smoothly. As a clip streams, RealOne Player communicates with Helix Universal Server about the clip's progress, indicating how much data it needs to keep playback flowing smoothly. Helix Universal Server 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.
You can place a comment to a Ram file by using a pound sign (#) as the first character on a line. The following example shows a Ram file with two comment lines:
# Three videos that play in sequence. |
A Ram file provides a simple and convenient way to set parameters that open
HTML pages in the RealOne Player related info and media browser panes.
Ram file parameters can also affect the media by shortening a clip's playback
time, for instance. In the Ram file, separate the first parameter from the clip
URL with a question mark (?), as shown here:
|
To set two or more parameters for the same clip, precede the second and all
subsequent parameters with ampersands (&) instead of question marks:
|
Note the following about Ram file parameters:
| Tip: Appendix D summarizes the Ram file parameters that the following sections describe in detail. |
For each clip in the Ram file, you can provide the URL to one HTML page that opens in the RealOne Player related info pane. You can also provide a URL to an HTML page that opens in the media browser pane. The following table lists the Ram file HTML page parameters.
| Parameter and Value | Function |
|---|---|
rpcontexturl=URL| |
Displays the specified URL in the related info pane, or keeps the existing related info pane open. Use a fully qualified HTTP URL. If testing with a local clip, use the full, absolute path to the clip on your computer. |
rpcontextheight=pixels |
Sets the pixel height of the related info pane. If no height is specified, RealOne Player uses the height of the media clip. See "Related Info Pane Sizing" for more information. |
rpcontextwidth=pixels |
Sets the pixel width of the related info pane. If no width is specified, a default of 330 pixels is used. |
rpcontextparams=URL_parameters |
Appends parameters to the rpcontexturl URL. HTML page parameters are generally separated from the page URL with a question mark. In a Ram file, however a question mark indicates the start of the Ram file parameters. Hence, if you need to append parameters to your related info page URL, do so through rpcontextparams. |
rpcontexttime=dd:hh:mm:ss.x |
Specifies the time at which the HTML page displays in the related info pane, relative to the start of the media clip. Only the seconds (ss) field is required, so rpcontexttime=10 means to open the related info pane 10 seconds after the clip starts to play. If no time is specified, the page opens as soon as the clip starts to play. Use of start=hh:mm:ss.x with the clip does not affect when the HTML page displays. |
rpurl=URL |
Specifies the URL to display in the media browser pane. This URL always opens when the clip begins to play. If testing with a local clip, use the full, absolute path to the clip on your computer. |
rpurlparams=URL_parameters |
Appends parameters to the rpurl URL. If you need to add parameters to your media browser page URL, do so through rpurlparams. |
rpurltarget=_rpbrowser|name |
Sets the target for rpurl as the media browser pane when you use _rpbrowser, or as a secondary browsing window if you use any other name. Because the default is _rpbrowser, you can omit this parameter to use the media browser. |
rpvideofillcolor=color_value |
Specifies a background color for the media playback pane, allowing you to match the backgrounds of the media playback and related info panes. Black is the default color. See below for more about colors. |
| Tip: To open more than one HTML page for a clip in the related info pane or media browser pane at any point during the presentation, you can write a SMIL file as described in Chapter 6. |
For rpvideofillcolor, you can use one of 16 predefined color names, an RGB
value, or a six-digit hexadecimal value. Illustration programs typically define
colors using the RGB scheme, while the hexadecimal scheme is common to
HTML markup programs. The following table lists the predefined names,
along with that color's corresponding hexadecimal and RGB values.
With a hexadecimal color value, substitute the escape character %23 for the
pound sign (#), which, in a Ram file, signifies the start of a comment. For
example, suppose that you want to match the following hexadecimal color
used in a related info HTML page:
<BODY BGCOLOR="#FF5A4E"> |
You would add the following to your Ram file:
rpvideofillcolor=%23FF5A4E |
The following example plays a clip and opens an HTML page in a related info pane that is 250 pixels high and 280 pixels wide:
rtsp://helixserver.example.com/video1.rm?rpcontextheight=250 |
The next example opens an HTML page in the media browser pane when the clip begins to play:
rtsp://helixserver.example.com/video2.rm?rpurl="http://www.example.com/index.html" |
The following sample Ram file plays two clips in sequence. After the first clip
plays for 5.5 seconds, the Ram parameters open an HTML page in a related
info pane that is 350 pixels high by 300 pixels wide. The media playback
pane's background color is set to rgb(30,60,200). When the second clip plays,
the same related info pane is kept onscreen, but the media playback pane's
background changes to red:
# First URL that opens a related info pane. |
In the Ram file, you can set several parameters that control how RealOne Player initially displays a clip or SMIL presentation. You can play a clip at double its normal size, for example, play part of a clip, or open the RealOne Player at full-screen size. To control these characteristics, add one or more of the following parameters to the Ram file URL.
| View it now!
(requirements for viewing this sample)
The first sample plays a clip at normal size, then at double-size. The second sample plays a clip in full-screen mode. The third sample uses start and end to play a portion of a
clip. You can also open clips in theater mode or,
for subscribers to premium services, toolbarmode.
|
The following example opens a SMIL presentation in full-screen mode:
rtsp://helixserver.example.com/sample1.smil?screensize=full |
The next example opens a video clip at double its normal size, and sets RealOne Player to its theater mode:
rtsp://helixserver.example.com/video1.rm?screensize=double&mode=theater |
The final example plays a 30-second excerpt from the middle of a clip:
rtsp://helixserver.example.com/audio1.rm?start=55&end=1:25 |
screensize=full.mode parameter when using screensize=full.start and end timing values you want to use in a Ram file.clipBegin and clipEnd in the clip source tag, rather than start and end in the Ram file, to play an excerpt from a clip. For more information, see "Using Internal Clip Begin and End Times".showvideocontrolsoverlay parameter is intended primarily for media presentations that include interactive elements, such as Flash clips or SMIL presentations. It allows you to hide the overlay so that it does not interfere with buttons or controls that are part of the media.A streaming clip often encodes title, author, and copyright information. When you encode a RealAudio or RealVideo clip, for example, you can add this information to the clip through Helix Producer. Through the Ram file, you can override this title, author, and copyright information. These parameters are compatible with earlier versions of RealPlayer.
| View it now!
(requirements for viewing this sample)
This sample uses title, author, and copyright
parameters in a Ram file to override information encoded
in a clip. You can view the information supplied by the Ram
file by pressing Ctrl+i.
|
The following example sets title, author, and copyright information for a video clip:
rtsp://helixserver.example.com/introvid.rm?title="Introduction to Streaming |
title, author, and copyright parameters in a Ram file, but RealNetworks highly recommends that you always include title parameters for clips that have no encoded titles. If no title is available, a clip's file name displays in place of the title.The clipinfo parameter is new with RealOne Player, and is ignored by earlier
RealPlayers. Geared for online music, it allows you to encode information
such as the artist name, album, genre, and so on, which displays when the
viewer chooses the File>Clip Properties>View Clip Info command, or presses
Ctrl+i. The clipinfo parameter uses one long value surrounded by double
quotation marks. Within the quotes, you separate the subvalues with vertical
lines, or "pipes," as shown here:
clipinfo=" |
The following table describes the name and value pairs that you can use with
clipinfo. You can use any set of values, and list them in any order. Most text
values can be over 100 characters long.
Note:
Do not use the title, author, and copyright parameters
described in "Overriding Title, Author, and Copyright
Information" along with clipinfo.
|
| View it now!
(requirements for viewing this sample)
This sample demonstrates how the clipinfo parameter
in a Ram file can set clip information, which you can view
by pressing Ctrl+i.
|
To use certain text characters in a value for the clipinfo parameter, you must
use the character's corresponding escape code. This is because certain
characters represent syntax components. A pipe (|) represents the start of a
new value, for example, so to use a pipe within a value, you must use the
escape code %7C. The following table lists some common text characters that
you can add through escape codes.
You can enter other common text characters, such as commas, periods, and
colons directly into clipinfo parameter. Conversely, you can display any text
character, including letters and numbers, by using an escape code that starts
with % followed by the character's ASCII hexadecimal value. You can create an
asterisk (*) with the escape code %2A, for example.
| For More Information: Visit http://www.asciitable.com for a full list of ASCII codes. |
This example sets the clipinfo parameter for an audio clip:
rtsp://helixserver.example.com/song1.rm?clipinfo="title=Artist of the Year| |
The following figure illustrates how this information appears in the clip information panel (Ctrl+i).
When your media clips, Web pages, and Ram file are ready for delivery, transfer them to your Web server and Helix Universal Server, placing them in the directories prepared by the server administrators. If a server is on the same local area network (LAN) as your computer, you can often just copy the files to the server over the network. Otherwise, you can usually transfer files to a server over the Internet using FTP (file transfer protocol).
The FTP protocol is designed to copy files from one computer to another. Many computers have an FTP application preinstalled. FTP applications are also available for download from many Internet software archives. Your Helix Universal Server or Web server administrator will have to set up FTP access to the server machine for you, as well as give you an FTP user name and password.
FTP distinguishes between a "text" mode for transferring text-only files, and a "binary" mode for transferring non-text files such as streaming media clips. Some FTP programs can set this mode automatically. With other programs, though, you must set the transfer mode yourself. If you transfer streaming clips in text mode, the clip may become corrupt. Fortunately, FTP never modifies the original clips on your computer, so you can simply transfer the clips again using the binary mode.
| Tip: Helix Producer and RealSlideshow can transfer files to a server automatically. Refer to their user manuals or online help for more information. |
Move your Ram file to Helix Universal Server or your Web server. Even if all of your media clips are on Helix Universal Server, you can place the Ram file on your Web server or any other server. Your Web page, Ram file, and media clips do not have to reside together. If you keep the Ram file in the same directory as your main Web page, you can use a relative link like the following:
<a href="play_video1.ram">Play the video!</a> |
If the Ram file is in a different location, use a full HTTP URL in the link to the Ram file:
<a href="http://www.example.com/play_video1.ram">Play the video!</a> |
Then, make sure that the Ram file gives RealOne Player either the full RTSP URL to the clip on Helix Universal Server:
rtsp://helixserver.example.com/video1.rm |
or the full HTTP URL to the clip on a Web server:
http://www.example.com/video1.rm |
|
|
©2002 RealNetworks, Inc. All rights reserved.
For more information, visit RealNetworks Click here if the Table of Contents frame is not visible at the left side of your screen. |