An application, applet, or control can use the following methods to communicate with RealPlayer G2. For method data types, refer to RAPlayer.java, included in the rpcl3260.zip file installed in the RealPlayer folder. RealPlayer 5.0 supports a limited set of these methods as described in "RealPlayer 5.0 Compatibility".
Plays the current clip. Equivalent to clicking the Play button.
Returns TRUE
or FALSE
. Returns TRUE
if the player is currently paused or stopped, and current source file is valid.
Stops the clip. Equivalent to clicking the Stop button. This method is backwards-compatible with RealPlayer 5.0.
Returns TRUE
if RealPlayer is currently playing a clip or is paused. This method is backwards-compatible with RealPlayer 5.0.
Pauses the current clip. Equivalent to clicking the Pause button.
Returns TRUE
if the player is currently playing a clip.
Returns TRUE
if the player is currently playing, paused, or stopped, and current source file is valid. Backwards-compatible with RealPlayer 5.0. If supporting only RealPlayer G2, use CanPause()
and CanPlay()
instead.
Plays or pauses the current clip. Backwards-compatible with RealPlayer 5.0. If supporting only RealPlayer G2, use DoPause()
and DoPlay()
instead.
Returns the current state of the RealPlayer. Values are numerical, with the following meanings:
0 Stopped
1 Contacting
2 Buffering
3 Playing
4 Paused
5 Seeking
Returns number of milliseconds of elapsed buffering time.
![]() |
Note |
---|
The GetBufferingtimeElapsed() method is not currently
supported. It will be supported in an upcoming release.
|
Returns estimated remaining buffering time in milliseconds.
Returns whether or not PreFetch is enabled.
Enables/disables PreFetch playback mode. Valid values are TRUE
and FALSE
with FALSE
as the default.
![]() |
Additional Information |
---|
See "Using PREFETCH with <EMBED>" or "Using PREFETCH with <OBJECT>". |
Returns the visible components of the control.
![]() |
Additional Information |
---|
For valid control names, see the chapter on Web page playback in RealSystem G2 Production Guide at http:// service.real.com/help/library/index.html. |
Sets the visible components of the control. Compatible only with RealPlayer G2.
Sets the visible components of the control. Method is identical to SetControls()
, but is compatible with RealPlayer 5.0 Netscape Plug-in (though not the 5.0 ActiveX control). If supporting only RealPlayer G2, use SetControls()
instead.
Returns a console name used to link multiple control instances. Call this function once for each instance of a control you want to link.
Sets a console name used to link multiple control instances. Call this once for each instance of a control you want to link. All controls with the same console name work together. For example, if you have multiple Play and Stop buttons on the same page, a shared console name enables them to control the same clip. The console name _master
links to all instances. The console name _unique
links to no other instances.
Functionally identical to SetConsole()
, but backwards-compatible with RealPlayer 5.0 Netscape plug-in (though not the 5.0 ActiveX control). If supporting only RealPlayer G2, use SetConsole()
instead.
Sets whether or not the control automatically starts playing once the source data is available. Valid values are TRUE
and FALSE
. This method is compatible with the RealPlayer 5.0 Netscape Plug-in but not its ActiveX control.
Returns whether or not playback will start automatically.
Specifies how a URL will be handled. This method is backwards-compatible with RealPlayer 5.0. Valid values are:
TRUE
RealPlayer plug-in automatically forwards URL event to browser.
FALSE
onGoToURL() event handled by Java applet or VBScript instead.
![]() |
Additional Information |
---|
With RealPlayer G2, this can also be set with the
AUTOGOTOURL parameter in the <EMBED> or <OBJECT> tag.
See "Handling URLs through <EMBED>" or "Handling
URLs through <OBJECT>".
|
Returns whether or not AutoGotoURL property is enabled.
For the RealPlayer 5.0 and G2 ActiveX control only, this method causes the control to attempt a navigation to the specified URL in the specified frame target. The container must support URL browsing. Parameters are:
string URL
Specifies whether the clip will loop or not. Valid values are TRUE
(loops until play is interrupted) and FALSE
(default).
Returns whether the clip has been set to loop.
Sets number of times to loop the clip. Takes an integer as its parameter.
Returns number of loops set in SetNumLoop()
.
Sets whether or not the visual datatype should be centered at its natural size within the image window. Valid values are TRUE
and FALSE
(default).
Returns whether or not the visual datatype will be centered within the image window. Valid values are TRUE
and FALSE
.
Maintains correct aspect ratio of source within image window when stretched. Valid values are TRUE
and FALSE
(default).
Returns whether or not the aspect ratio of the visual datatype will be maintained.
Specifies the desired background color for the image window control. Valid values are a RGB hexadecimal color value in the format #RRGGBB
, or the following color names, shown here with their corresponding RGB values:
Returns hexadecimal value for current background color.
Determines whether to suppress the display of RealLogo in image window control. Image window defaults to black unless a background color has been specified. Valid values are TRUE
and FALSE
(default).
Returns whether or not the RealLogo will be displayed in the image window.
Suppresses the Title, Author, and Copyright label text in the controls window of RealPlayer 5.0. The content text strings are still displayed. This method does not affect RealPlayer G2 but is compatible with it.
Returns whether or not Title, Author, and Copyright labels will be suppressed.
Randomizes playback of all clips, excluding clips that have already played. Works for multiclip RAM files (.ram
or .rpm
) or SMIL files that contain only a sequence of clips. Valid values are TRUE
and FALSE
.
Returns whether shuffle play is enabled.
Specifies the URL of the clip to play. The source URL can begin with rtsp://
, http://
, pnm://
, or file://
. This method is backwards-compatible with the RealPlayer 5.0 Netscape plug-in, though not the 5.0 ActiveX control.
Returns the URL of the playing clip.
Sets whether the user can seek within the clip through the user interface. Valid values are TRUE
(default) and FALSE
. Live or simulated live clips are always FALSE
.
Live or simulated live clips return FALSE
.
Returns the current position in the clip in milliseconds. Valid values will be >=0
and <=
total clip length
.
Seeks into the clip the specified point in milliseconds. Valid values are =0
and <
total clip length.
If an attempt is made to set the position >total length
, then SetPosition()
will equal total length.
Returns the total length of the clip in milliseconds. Valid values are >=0
.
Returns the current clip's title string.
Sets the current clip's title string, overriding any existing title information. GetTitle()
subsequently returns this new value.
Returns the current clip's author string.
Sets the current clip's author string, overriding any existing author information. GetAuthor()
subsequently returns this new value.
Returns the current clip's copyright string.
Sets the current clip's copyright string, overriding any existing copyright information. GetCopyright()
subsequently returns this new value.
Returns the width of the clip window in pixels.
Returns the height of the clip window in pixels.
Tests if the next clip function is available. The next clip function is available when the connected source is a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips and the current clip is not the last clip in the RAM or SMIL file. In a SMIL file, a <par>
group is treated as a single clip. Returns TRUE
or FALSE
.
Tests if the next clip function is available. The next clip function is available when the connected source is a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips and the current clip is not the last clip in the RAM or SMIL file. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use HasNextEntry()
instead.
Skips to the next clip in the RAM (.ram
or .rpm
) or SMIL file that contains multiple clips. In a SMIL file, a <par>
group is treated as a single clip.
Skips to the next clip in the RAM (.ram
or .rpm
) or SMIL file that contains multiple clips. In a SMIL file, a <par>
group is treated as a single clip. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use DoNextEntry()
instead.
Tests if the previous clip function is available. The previous clip function is available when the connected source is a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips and the current clip is not the first clip in the RAM file. In a SMIL file, a <par>
group is treated as a single clip. Returns TRUE
or FALSE
.
Tests if the previous clip function is available. The previous clip function is available when the connected source is a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips and the current clip is not the first clip in the RAM file. In a SMIL file, a <par>
group is treated as a single clip. Returns TRUE
or FALSE
. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use HasPrevEntry()
instead.
Skips to the previous clip in a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips. In a SMIL file, a <par>
group is treated as a single clip.
Skips to the previous clip in a RAM (.ram
or .rpm
) or SMIL file that contains multiple clips. In a SMIL file, a <par>
group is treated as a single clip. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use DoPrevEntry()
instead.
Returns the number of the entry currently playing.
Returns the total number of entries in the playlist.
Returns the Title for the specified playlist entry.
Returns the Author for the specified playlist entry.
Returns the Copyright for the specified playlist entry.
Returns the Abstract for the specified playlist entry.
Returns whether the current clip is live. Valid values are TRUE
or FALSE
.
Sets the RealPlayer Statistics dialog box to visible. Valid values are TRUE
or FALSE
.
Returns whether or not the RealPlayer Statistics dialog box is visible.
Sets the RealPlayer Statistics dialog box to visible. Valid values are TRUE
(hidden) or FALSE
. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use SetShowStatistics()
instead.
Returns whether or not the RealPlayer Statistics dialog box is visible. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use GetShowStatistics()
instead.
Displays the RealPlayer Preferences dialog box.
Returns whether or not the Preferences dialog box is visible.
Displays the RealPlayer Preferences dialog box. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use SetShowPreferences()
instead.
Displays the RealPlayer About dialog box. Use with RealPlayer G2 only.
Displays the RealPlayer About dialog box. Use with RealPlayer G2 and 5.0. If supporting only RealPlayer G2, use SetShowAbout()
instead.
Returns whether or not the About box is open.
Sets error sink. Valid values are TRUE
(errors trapped, no error dialogs in player) and FALSE
(error dialogs in player).
Returns whether error dialogs will be displayed.
Returns the "more info" URL from the last error. May return nothing.
Returns RMA error code from the last error. RMA error codes are described in the header file pnresult.h in the RealSystem G2 SDK available at http://www.real.com/devzone/. In normal operation, all RealSystem components need to be able to handle the following basic codes that may be returned by the RealSystem system:
Returns error level for last error.
Returns user error code from last error.
Returns error string from last error dialog. May return nothing.
Returns text of last status message.
Sets the image window to its original size.
Returns whether the image is currently in its original size. TRUE
indicates original size.
Sets the image window to double size.
Returns whether or not image is currently in double-size mode. TRUE
indicates double size.
Sets the image to full-screen mode.
Returns whether or not image is currently in full-screen mode. TRUE
indicates full-screen mode.
Sets the volume level. Valid values are 0-100.
Sets the mute state. Valid values are TRUE
and FALSE
.
Returns whether or not the volume has been muted.
Returns whether the current clip is in stereo. Returns TRUE
for stereo or FALSE
for mono.
Specifies whether the control will display the default context menu when the right mouse button is clicked. Valid values are TRUE
(enabled, default) and FALSE
(disabled).
Returns whether or not contextual menu is currently enabled. Returns TRUE
(enabled, default) or FALSE
(disabled).
Enables the original size option on contextual menu. Valid values are TRUE
(default) and FALSE
.
Returns whether the original size option is enabled on the contextual menu.
Enables the double size option on contextual menu. Valid values are TRUE
and FALSE
(default).
Returns whether or not the double size option is enabled on the contextual menu.
Enables the full screen option on contextual menu. Valid values are TRUE
(default) and FALSE.
Returns whether or not the full screen option is enabled on the contextual menu.
Sets whether Status text should be written to the image window.
Returns whether Status text is written to the image window.
Returns a string with the source protocol used for playback. Takes as value an integer from 1
to n
, where n
is the number of sources returned by GetNumSources()
.
Returns number of sources in the presentation.
Returns total number of packets in the presentation.
Returns the total packets received from the server.
Returns the total packets received from the server out of order.
Returns the total packets not received from the server in time to play.
Returns the total packets received from the server before they are ready to play.
Returns the total packets received from the server that are too late to play.
Returns the average amount of bandwidth available.
Returns the current amount of bandwidth available.
Returns major and minor version information for the embedded RealPlayer (not the parent RealPlayer), such as 6.0.0.128
.
Returns whether the client is RealPlayer Plus.
Sets whether keyboard events will be sent. Valid values are TRUE
and FALSE
(default).
Returns whether keyboard events will be sent.
Sets whether mouse events will be sent. Valid values are TRUE
and FALSE
(default).
Returns whether mouse events will be sent.
Returns the normal, maximum bandwidths settings as set by the user in the RealPlayer preferences.
Returns the preferred language for content as set by the user in the RealPlayer preferences.
Returns the preferred language ID. For a list of language codes, see the SMIL language codes appendix in RealSystem G2 Production Guide.
Returns the country that the user selected during electronic registration.
The following methods are used with RealPlayer G2 and RealPlayer 5.0. To support both versions of RealPlayer, your application can issue only this set of commands: