RealAudio and RealVideo enables seamless integration of RealPlayer Controls
into your Web page layout. You can place individual interactive components,
such as a play button or image window, anywhere on your page, just as you
would place an image using the <IMG>
tag in HTML.
There are two products which, in conjunction with the most popular Web browsers, enable "in page" audio controls.
The Plug-in runs as an adjunct to Web browsers that support Netscape's Plug-in architecture. The RealPlayer Plug-in is included in the RealPlayer installation.
The <EMBED>
tag specifies Plug-in attributes in HTML
pages in much the same way that the <IMG>
tag
specifies image attributes. The basic <EMBED>
tag for
RealPlayer contains only the attributes SRC
, WIDTH
,
and HEIGHT
, as shown below:
<EMBED SRC=metafile.rpm WIDTH=width_value HEIGHT=height_value>
For example:
<EMBED SRC="sample1.rpm" WIDTH=300 HEIGHT=134>
creates an in-page RealPlayer that is 300 pixels wide and 134 pixels high.
For the Plug-in, metafiles are stored with a .rpm file name extension.
The name tag is supported as an option with JavaScript to refer to a specific plug-in.
Do not place the <EMBED>
tag within a table.
Feature | Description |
SRC Attribute | The SRC attribute specifies a metafile to be accessed. RealPlayer Plug-in is associated with a .rpm file name extension. This extension tells the user's Web browser to load RealPlayer Plug-in rather than the stand-alone RealPlayer. For the user's Web browser to correctly identify .rpm files, you or your system administrator must first configure the .rpm MIME type in your Web server. Users do not need to configure their Web browsers to recognize the .rpm MIME type. The plug-in architecture automatically sends .rpm files to RealPlayer Plug-in. Files with a .rpm extension are identical to .ram files, except for the extension. |
WIDTH and HEIGHT Attributes | The WIDTH and HEIGHT attributes specify the size of the embedded RealAudio or RealVideo component. Unlike images, Plug-ins do not size automatically. The WIDTH and HEIGHT can be specified in pixels (the default) or as a percentage of the Web browser window (for example: WIDTH=100%). Note If the WIDTH and HEIGHT attributes are not included, the Plug-in may appear as a tiny (and useless) icon with some browsers. If you want your Plug-in component to maintain an absolute size, specify HEIGHT and WIDTH in pixels. If you want the Plug-in graphic to scale with the Web browser window, specify size as a percentage. For example, if you want to fit the entire width of the Web browser window, use WIDTH=100%. |
CONTROLS attribute | The CONTROLS attribute of the <EMBED> tag allows you to place individual control elements within your page. You can use multiple <EMBED> statements to construct a custom interface, made up of individual controls. You can also place multiple controls within a single <EMBED> statement. CONTROLS supports the following values: All, ControlPanel, InfoVolumePanel, InfoPanel, StatusPanel, StatusBar, PlayButton, StopButton, VolumeSlider, PositionSlider, PositionField, StatusField, ImageWindow. |
CONSOLE attribute | Sets a console name used to link multiple control instances. All controls with the same console name work together. For example, if you have multiple Play and Stop buttons on the same page, the console name would enable them to control the same RealAudio or RealVideo clip. Call this function once for each instance of the Play or Stop button you want to link. The console name. "_master" links to all instances. "_unique" links to no other instances. |
AUTOSTART attribute | Sets whether or not the control automatically starts playing once the source data is available. Valid values are TRUE or FALSE. |
NOLABELS attribute | Suppresses the TitleTitle setting, AuthorAuthor, and CopyrightCopyright label text in the controls window. The text strings in the fields are still displayed. |
RESET attribute | Resets RealPlayer Control for ActiveX playlist. Valid values are TRUE or FALSE. |
AUTOGOTOURL attribute | Specifies how a URL is handled. Valid values are TRUE or FALSE. TRUE indicates that RealPlayer Control for ActiveX automatically forwards the URL event to the browser. FALSE indicates that the OnGotoURL VBScript event is used instead. |
Some Web browsers do not support plug-ins. You can create HTML pages
that are enhanced for plug-ins but which also work for other browsers. Simply
use the <NOEMBED
> tag to include HTML statements for
use by Web browsers that do not support Plug-ins.
The <NOEMBED
> command should appear after an <EMBED
>
command and take the following syntax:
<NOEMBED> HTML to be ignored </NOEMBED>
For example, the command:
<EMBED SRC="sample1.rpm" WIDTH=300 HEIGHT=134>
<NOEMBED> <A HREF="sample1.ram"> Please
play the clip using the stand-alone RealPlayer. </A></NOEMBED>
would show a page with the Plug-in if your page were accessed by a browser supporting Plug-ins, and would otherwise display the message "Please play the clip using the stand-alone RealPlayer." (and allow playback with the standard RealPlayer).
You can embed RealPlayer Control for ActiveX in HTML pages using the Object tag.
The following is an example of RealPlayer Control <OBJECT> in an HTML page.
<OBJECT ID=RAOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=140 WIDTH=312> <PARAM NAME="SRC" VALUE="pnm://audio.real.com/file.rm"> <PARAM NAME="CONTROLS" VALUE="all"> </OBJECT>
Directory names cannot have spaces.
Feature | Description |
OBJECT | Tag is used to embed RealPlayer Control for ActiveX. There should be one
<OBJECT > tag per RealPlayer Control on the page. |
CLASSID | Specifies the control's CLSID. This value is always "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" for RealPlayer Control for ActiveX. |
HEIGHT | Specifies the control's height on the HTML page. A value of 0 makes the control invisible. |
WIDTH | Specifies the control's width on the HTML page. A value of 0 makes the control invisible. |
PARAM | Specially embedded tag for supplying parameters to the ActiveX object. |
The following properties are available to the PARAM setting:
Property | Description |
SRC | Sets the source of RealAudio or RealVideo clip. The SRC location can be pnm, file or http protocol. This parameter is required. |
CONTROLS | Sets the visible components of the control. Valid CONTROLS include All, ControlPanel, InfoVolumePanel, InfoPanel, StatusPanel, StatusBar, PlayButton, StopButton, VolumeSlider, PositionSlider, PositionField, StatusField, and ImageWindow. |
CONSOLE | Sets a console name used to link multiple control instances. All controls with the same console name work together. For example, if you have multiple Play and Stop buttons on the same page, the console name would enable them to control the same RealAudio or RealVideo clip. Call this function once for each instance of the Play or Stop button you want to link. The console name. "_master" links to all instances. "_unique" links to no other instances. |
AUTOSTART | Sets whether or not the control automatically starts playing once the source data is available. Valid values are TRUE or FALSE. |
NOLABELS | Suppresses the TitleTitle setting, AuthorAuthor, and CopyrightCopyright label text in the controls window. The text strings in the fields are still displayed. |
RESET | Resets RealPlayer Control for ActiveX playlist. Valid values are TRUE or FALSE. |
AUTOGOTOURL | Specifies how a URL is handled. Valid values are TRUE or FALSE. TRUE indicates that RealPlayer Control for ActiveX automatically forwards the URL event to the browser. FALSE indicates that the OnGotoURL VBScript event is used instead. |
The CONTROLS attribute allows you to place individual control elements within your page. The CONTROLS attributes for the Netscape Navigator Plug-in and RealPlayer ActiveX Control are the same. The following explains the output of each attribute:
All - Displays a full Player view including the Control Panel, Information-and-Volume Panel and Status Bar.
Minimum Width: 21% Maximum Width: 100%
Minimum Height: 23% Maximum Height: 80%
InfoVolumePanel - Displays the Title, Author, and Copyright information panel and the volume slider.
Minimum Width: 21% Maximum Width: 100%
InfoPanel - Displays the Title, Author, and Copyright information.
Minimum Width: 20% Maximum Width: 100%
Minimum Height: 10% Maximum Height: 50%
ControlPanel - Displays the play/pause button, the stop button and the position slider.
Minimum Width: 21% Maximum Width: 100%
Minimum Height: 8% Maximum Height: 25%
StatusPanel - Displays the Status Panel showing informational messages, current time position, and clip length. If you do not embed a Status Panel in your page, error messages are displayed in the Web browser's status bar.
PlayButton - Displays the play/pause button.
Minimum Width: 5% Maximum Width: 100%
Minimum Height: 2% Maximum Height: 25%
StopButton - Displays the stop button.
Minimum Width: 5% Maximum Width: 100%
Minimum Height: 2% Maximum Height: 25%
VolumeSlider - Displays the volume slider.
Minimum Width4% Maximum Width100%
Minimum Height10% Maximum Height100%
PositionSlider - Displays the position slider.
Minimum Width 8% Maximum Width 100%
Minimum Height 5% Maximum Height 25%
PositionField - Displays the field of the Status Bar showing position and clip length.
Minimum Width: 10% Maximum Width: 100%
Minimum Height: 4% Maximum Height: 25%
StatusField - Displays the message text area of the Status Bar.
Minimum Width: 13% Maximum Width: 100%
Minimum Height: 4% Maximum Height: 15%
ImageWindow - Displays the video image. (Only available for .rm files)
Minimum Width: 100% Maximum Width: 100%
Minimum Height: 100% Maximum Height: 100%
StatusBar - Displays the status field, position field, channels (stereo/mono).
Minimum Width: 21% Maximum Width: 100%
Minimum Height: 5% Maximum Height: 14%
Methods are functions that control the performance of the Control. Unless
otherwise noted, these methods have no return values and no parameters.
Method | Description |
DoPlayPause | Plays or pauses the current clip. Equivalent to clicking the Play/Pause button. |
DoStop | Stops the clip. Equivalent to clicking the Stop button. |
DoNextItem | Skips to the next clip in a .ram file that contains multiple clips. A .ram file is a metafile that points to one or more RealAudio or RealVideo files. |
DoPrevItem | Skips to the previous clip in a .ram file that contains multiple clips. A .ram file is a metafile that points to one or more RealAudio or RealVideo files. |
CanPlayPause | Tests if Play/Pause function is available. Returns TRUE or FALSE |
CanStop | Tests if Stop function is available. Returns TRUE or FALSE. |
HasNextItem | Tests if the next clip function is available. The next clip function is available when the connected source is a .ram file that contains multiple clips, and the current clip is not the last clip in the .ram file. Returns true or false. |
HasPrevItem | Tests if the previous clip function is available. The previous clip function is available when the connected source is a .ram file that contains multiple clips, and the current clip is not the first clip in the .ram file. Returns true or false. |
AboutBox | Opens the CopyrightCopyright information for the control. |
EditPreferences | Opens the Preferences dialog box. Enables the end user to set his or her preferences. These preferences are global to all RealAudio or RealVideo clients on the machine. |
HideShowStatistics | Shows or hides the Connection Statistics dialog box. |
IsStatisticsVisible | Tests if the Connection Statistics dialog box is displayed. Returns true or false. |
DoGotoURL(url, target) | Causes the control to attempt a navigation to the specified URL in the specified frame target. The container must support URL browsing. Parameters: string URL, string target. |
The object properties are set within Visual Basic and specify properties
about the control.
Property | Description |
Source | Specifies the URL of the clip to play. The Source location can be pnm:, file: or http: protocol. |
Controls | Returns/Sets the visible components of the control. Valid CONTROLS include ALL, ControlPanel, InfoVolumePanel, InfoPanel, StatusBar, StatusPanel, PlayButton, StopButton, VolumeSlider, PositionSlider, PositionField, ImageWindow and StatusField. |
Console | Sets a console name used to link multiple control instances. All controls with the same console name work together. For example, if you have multiple Play and Stop buttons on the same page, the console name would enable them to control the same clip. Call this function once for each instance of the Play or Stop button you want to link. The console name "_master" links to all instances while unique links to no other instances. |
Autostart | Sets whether or not the control automatically starts playing once the source data is available. Valid values are TRUE or FALSE. |
NoLabels | Suppresses the Title, Author, and Copyright label text in the controls window. The text strings in the fields are still displayed. |
AutoGotoURL | Specifies how a URL will be handled. Valid values are TRUE or FALSE. TRUE indicates that the ActiveX Control will automatically forward the URL event to the browser. FALSE indicates that the OnGotoURL VBScript event will be sent instead. |
Methods are functions that control the performance of the Java enabled RealPlayer Plug-in.
Method | Description |
SetSource(String Source) | Specifies the URL of the RealAudio clip to play. The Source location can be pnm:, file: or http: protocol. |
SetControlsString (String ControlsString) |
Returns/Sets the visible components of the control. Valid CONTROLS include ALL, ControlPanel, InfoVolumePanel, InfoPanel, StatusBar, PlayButton, StopButton, VolumeSlider, PositionSlider, PositionField, StatusField, StatusPanel, and ImageWindow. |
SetConsoleName (String ConsoleName Boolean True) |
Sets a console name used to link multiple RealVideo Plug-in instances. All Plug-ins with the same console name work together. For example, if you have multiple Play and Stop buttons on the same page, the console name would enable them to control the same clip. Call this function once for each instance of the Play or Stop button you want to link. The console name "_master" links to all instances while unique links to no other instances. |
SetAutoStart(Boolean bAutoStart) | Sets whether or not the Plug-in automatically starts playing once the source data is available. Valid values are TRUE or FALSE. |
SetNoLabels(Boolean bNoLabels) | Suppresses the TitleTitle setting, AuthorAuthor, and CopyrightCopyright label text in the Plug-in window. The text strings in the fields are still displayed. |
DoPlayPause() | Plays or pauses the current clip. Equivalent to clicking the Play/Pause button. |
DoStop() | Stops the RealAudio clip. Equivalent to clicking the Stop button. |
DoNextItem() | Skips to the next clip in a .ram file that contains multiple clips. A .ram file is a metafile that points to one or more RealAudio files. |
DoPrevItem() | Skips to the previous clip in a .ram file that contains multiple clips. A .ram file is a metafile that points to one or more RealVideo files. |
CanPlayPause() | Tests if Play/Pause function is available. Returns TRUE or FALSE |
CanStop() | Tests if Stop function is available. Returns TRUE or FALSE. |
HasNextItem() | Tests if the next clip function is available. The next clip function is available when the connected source is a .ram file that contains multiple clips, and the current clip is not the last clip in the .ram file. Returns true or false. |
HasPrevItem() | Tests if the previous clip function is available. The previous clip function is available when the connected source is a .ram file that contains multiple clips, and the current clip is not the first clip in the .ram file. Returns true or false. |
AboutBox() | Opens the CopyrightCopyright information for the control. |
EditPreferences() | Opens the Preferences dialog box. Enables the end user to set his or her preferences. These preferences are global to all clients on the machine. |
HideShowStatistics() | Shows or hides the Connection Statistics dialog box. |
IsStatisticsVisible() | Tests if the Connection Statistics dialog box is displayed. Returns true or false. |
CallBack methods are functions that provide notification from the RealAudio or RealVideo engine. CallBack methods can only be used with Java applets by implementing the RAObserver interface.
For more information about these methods, visit the DevZone page at www.real.com.
Method | Description |
onClipOpened(String shortClipname, String URL) | Sent when a clip has been opened. |
onClipClosed() | Sent to indicate that no clip is currently open. |
onShowStatus(String status) | Sent to indicate that the status text is changing. |
setAutoGoToURL (boolean bAutoGoToURL) |
Specifies how a URL will be handled. Valid values are true or false. True indicates that the RealPlayer Plug-in will automatically forward the URL event to the browser. False indicates that the OnGoToURL event will be handled by the Java applet instead. |
onGoToURL(String url, String target) | Sent when a URL event has been encountered for the currently playing clip. This event will only occur if the AutoGotoURL property is false. |
The more exciting features of RealPlayer Plug-in and RealPlayer Control for ActiveX can be enabled by specifying custom attributes within your HTML documents.
If your Web page is in a language other than English, or if you want to use the Description fields to display information other than Title, Author, and Copyright, you may remove the Title, Author, and Copyright Labels from the information area. Controls that display Title, Author, and Copyright information for a clip, support a NOLABELS=TRUE attribute.
For example, allowing the default behavior
<EMBED SRC="use_lbl.rpm" WIDTH=350 HEIGHT=80 CONTROLS=InfoPanel>
or specifying NOLABELS=FALSE
<EMBED SRC="use_lbl.rpm" WIDTH=350 HEIGHT=80 CONTROLS=InfoPanel NOLABELS=FALSE>
results in the following display.
On the other hand, using NOLABELS=TRUE, for example:
<EMBED SRC="no_lbl.rpm" WIDTH=350 HEIGHT=80 CONTROLS=InfoPanel NOLABELS=TRUE>
produces the following InfoPanel:
Adding an AUTOSTART=TRUE attribute tells the user's browser to automatically begin playing your clip when the page is visited. You can use this feature to begin narration, to play a welcome message or start a video.
Since only one clip can play at a time, if you specify AUTOSTART for more than one control instance, only the last control to load will play. The order in which your files are delivered is dependent on the Web server and on the browser's cache size. This is not necessarily the order in which you put them within your HTML. Therefore, you should specify AUTOSTART for only one control instance per page.
If you want to play RealAudio or RealVideo clips without having a visible Plug-in control, you hide the control. By embedding a Plug-in in your page that has its size set to width=2 height=0, no image appears on your Web page. You can control the Plug-in with JavaScript.
For example:
<script Language=JavaScript>
function playSource()
{if (navigator.appName == "Netscape") {document.javaPlug1.DoPlayPause();}
else
{RAOCX.DoPlayPause();}
}
</script>
<A HREF="#" onClick="playSource()"><IMG SRC="button.gif"></A>
<OBJECT ID=RAOCX CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA"
WIDTH=2 HEIGHT=0>
<PARAM NAME="SRC" VALUE="pnm://audio.real.com/welcome.rm">
<PARAM NAME="CONTROLS" VALUE="PlayButton">
<embed src="start.rpm" Width=2 Height=0 Controls=PlayButton
name=javaPlug1>
</OBJECT>
The above example works in both Netscape and Internet Explorer. Only one control will appear on the Web page.
You can embed any number of RealPlayer controls within a Web page. Normally, each tag instance refers to different content. Sometimes, however, you may want to link two or more controls together. For example, you can create a play button and an image window that work as a pair.
To include multiple components that work together, specify a CONSOLE attribute for each control and assign this the same value in each instance. For example:
<EMBED SRC="sample1.rpm" WIDTH=30 HEIGHT=33 CONTROLS="PlayButton"
CONSOLE="Clip1">
<EMBED SRC="empty1.rpm" WIDTH=176 HEIGHT=144 CONTROLS="ImageWindow"
CONSOLE="Clip1">
Each <EMBED>
tag must have a unique SRC
attribute (if the same source is specified for two tags, one is ignored).
Create a dummy .rpm file (named, for example: empty1.rpm) for a second control
accessing a clip. Put a hard carriage return (ASCII code 13) into the dummy
file.
Specifying a CONSOLE
value of "_master"
links a particular control to all other RealPlayer Controls on the page.
Use this value, for example, to add a Status Bar to display information
for all clips, for example:
<EMBED SRC="sample1.rpm" WIDTH=300 HEIGHT=33 CONTROLS="StatusBar"
CONSOLE="_master">
Because many platforms, including Windows, only support one volume setting, all volume sliders act on the same underlying value and affect all clips regardless of CONSOLE name. For this reason, you may want to include only one volume slider per page, with no reference to a .rm file in its associated .rpm file.
If you only include an ImageWindow control on the Web page, the video stream may still be controlled by using the context sensitive pop-up menu. For Windows users, right-click the ImageWindow; Macintosh users, click and hold the mouse button until the pop-up menu appears.
A frame document describes the sub-HTML documents or frames that make up a window. The basic structure of a frame document is similar to that of a normal HTML document except that the FRAMESET tag replaces the BODY tag. Each frame is defined by the FRAME tag. In order to effectively use RealVideo, each FRAME tag needs the SRC and NAME attributes. The SRC points to the URL to be displayed in the frame. The NAME attribute assigns a name to the frame so that it can be targeted by links in other documents. The example below shows a simple frame document that would create two frames:
<HTML>
<FRAMESET ROWS="105,*">
<FRAME SRC="banner.html" NAME="banner">
<FRAME SRC="lyrics.html" NAME="Lyric">
</FRAMESET>
</HTML>
Frames and RealVideo and RealAudio content are synchronized in the same way that a regular Web page and RealVideo and RealAudio content are synchronized: a .rae file. The difference lies in the addition of the targeted frame name to the text file that is used to create the .rae file. The syntax for each entry should follow the format:
u starttime endtime &&framename&&EventURL
where:
u
stands for URL event (each line starts with the
letter u)
is the time into the clip when the new event is
shown
starttime
endtime
is the time into the clip when that event ends,
&&
is a delimiter
framename
is the frame name as specified in your frame
document
EventURL
(generally beginning with "http:"
or "file:") is the URL for that event (usually an HTML document).
The time format is:
[[[days:]hours:]minutes:]seconds[.tenths]
The lines of the input file must be in ascending order of start time. The end time should be at least one tenth of a second before the start time for the next event.
The example below shows an .rae input file for a Web site that displays lyrics as a song plays. Each verse is displayed within a frame called Lyric.
u 00:00:10.0 00:00:35.0 &&Lyric&&http://www.songs.com/ver1.html
u 00:00:35.0 00:00:50.0 &&Lyric&&http://www.songs.com/ver2.html
You cannot use frames within a presentation using RealPlayer as a helper application. You can only use frames within a multimedia presentation using the Plug-in or ActiveX Control.