previous

Chapter 4: CallBack Methods

This chapter describes the methods RealPlayer calls to inform an application of its state.

RealPlayer G2 Callbacks

onClipOpened(shortClipName,URL)

Sent when a clip is opened by the control. Parameters:


string shortClipName

string URL

onClipClosed()

Sent to indicate that no clip is currently opened by the control. No parameters.

onShowStatus(statusText)

Sent to indicate that the status text is changing. Parameter:


string statusText

onGoToURL(URL,target)

Sent when an URL event is encountered for the RealPlayer clip currently playing. This event occurs only if the AutoGotoURL property is FALSE. Parameters:


string URL

string target

OnPositionChange(current position, total length)

Called when the position in the clip changes. The current position of the clip (in milliseconds) is returned. Parameter:


long position

long length

OnLengthChange(length)

Called when the length of the clip changes, generally when a new clip is loaded. Parameter:


long length (in milliseconds)

OnVolumeChange(volume)

Called when the volume level changes. The current volume level value is returned. The valid volume range is 0-100, where 0 represents no volume. Parameter:


short volume

OnTitleChange(title)

Called when the title string changes. The new title string is returned. Parameter:


string title

OnAuthorChange(author)

Called when the author string changes. The new author string is returned. Parameters:


string author

OnCopyrightChange(copyright)

Called when the copyright string changes. The new copyright string is returned. Parameters:


string copyright

OnPlayStateChange(newPlayState)

Called when the play state changes. See GetPlayState() for play state values. Parameter:


long newPlayState

OnErrorMessage(Severity, RMAErrorCode, UserErrorCode, messageText, MoreInfoURL)

Called when an error occurs. See GetLastErrorRMACode() and GetLastErrorSeverity() for more information on error codes and severities.

OnBuffering(int Flags, short PercentComplete)

Returns percentage of buffering complete.

Note
The OnBuffering() method is not currently supported. It will be supported in an upcoming release.

OnContacting(String Hostname)

Called when RealPlayer contacts a host. Returns host name string.

OnKeyDown(int KeyCode)

Returns key code when user presses and holds down a keyboard key. Sent only when SetWantKeyboardEvents() is set to TRUE.

OnKeyPress(int KeyCode)

Returns key code when user presses and releases a keyboard key. Sent only when SetWantKeyboardEvents() is set to TRUE.

OnKeyUp(int Keycode)

Returns key code when user releases keyboard key. Sent only when SetWantKeyboardEvents() is set to TRUE.

OnLButtonDown(int nButtonFlags, int xPos, int yPos)

Returns mouse position and flags when user holds down the left mouse button. Sent only when SetWantMouseEvents() is set to TRUE.

OnLButtonUp(int nButtonFlags, int xPos, int yPos)

Returns mouse position and flags when user releases the left mouse button. Sent only when SetWantMouseEvents() is set to TRUE.

OnRButtonDblClk(int nButtonFlags, int xPos, int yPos)

Returns mouse position and flags when user double clicks the right mouse button. Sent only when SetWantMouseEvents() is set to TRUE.

OnRButtonUp(int nButtonFlags, int xPos, int yPos)

Returns mouse position and flags when user releases the right mouse button. Sent only when SetWantMouseEvents() is set to TRUE.

OnMouseMove(int nButtonFlags, int xPos, int yPos)

Returns mouse position and flags when user moves the mouse. Sent only when SetWantMouseEvents() is set to TRUE.

OnMute(boolean bIsMute)

Called when volume is muted.

OnPreFetchComplete()

Called when component has fetched the stream header information. Called if PREFETCH is set to true in the <EMBED> or <OBJECT> tag or GetPreFetch() is set to TRUE.

OnPreSeek(int OldTime, int NewTime)

Called when the user performs a seek by moving the presentation position slider. Returned values include the presentation time when the seek occured and the value for the seek-to time.

OnPostSeek(int OldTime, int NewTime)

Called when a seek completes. Returned values include the presentation time before the seek occured and the time value after the seek occurs.

OnPresentationClosed()

Called when the presentation stops.

OnPresentationOpened()

Called when the presentation starts.

RealPlayer 5.0 Compatibility

The following callback methods are used with RealPlayer G2 and RealPlayer 5.0. If you support both versions of RealPlayer, your application will receive only the following:


Copyright © 1998 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 12/18/98 at 17:51:32.
previous