previous next

Chapter 3: RealOne Player Events

This chapter provides a alphabetized reference to the event handlers you can use in the RealOne Player environment. For an overview of events and event handlers, see "Using RealOne Player Event Handlers".

RPOnBuffering

Indicates the type of buffering currently occurring, and the percentage of the buffering that has completed.

window.parent.extrenal.RPOnBuffering( flags, percent_complete )

flags

Integer value indicating the type of buffering. One of the following:

Value Description
0 Buffering start up.
1 Buffering resulting from a seek.
2 Buffering resulting from network congestion.
3 Buffering resulting from resuming after pausing a live presentation.

percent_complete

The amount of buffering completed, in percent.

RPOnPositionLengthChange

Indicates the current time position in the clip, and the total length of the clip. This event is called twice per second (that is, every 0.5 second) during the presentation playback.

windows.parent.external.RPOnPositionLenghtChange( position, length )

position

Contains the current position of the clip, in milliseconds.

length

The total length of the clip, in milliseconds.

The following example uses RPOnPositionLengthChange to synchronize HTML with your presentation when the presentation is running between the 5 and 10 second marks.

var flag = 0
function RPOnPositionLengthChange(position, length)
{
if ( position >= 5000 && position < 10000 && flag == 0 ) {
flag = 1
document.location = "http://www.real.com"
}
}

RPOnPreload

Performs tasks, such as preloading URLs, before loading the media stream in the Media Playback pane.

RPOnPreload()

The following example shows how you could call PreloadURL within RPOnPreload to cache two different URLs (www.example1.com and www.example2.com) before playback.

<head>
<script language=Javascript>
function RPOnPreload()
{
parent.window.external.PreloadURL(http://www.example1.com)
parent.window.external.PreloadURL(http://www.example2.com)
}
</script>
...

RPOnStateChange

Indicates the play state of RealOne Player has changed (for example from Play to Pause).

window.parent.external.RPOnStateChange( newPlayState )

newPlayState

Integer value indicating the current state. One of the following:

Value Description
0 Indicates the player is currently stopped.
1 Indicates the player is currently contacting.
2 Indicates the player is currently buffering.
3 Indicates the player is currently playing.
4 Indicates the player is currently paused.
5 Indicates the player is currently seeking.
6 Indicates the player is busy.


RealNetworks, Inc. ©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.
previous next