JavaScript API Reference
The ASPNetVideo JavaScript API provides an interface to control any of ASPNetWindowsMedia, ASPNetQuicktime or ASPNetRealPlayer at runtime using JavaScript client code.
The API can be accessed by using the accessor function below:
Accessor function
ASPNetMedia.Video(ControlName) |
Returns an object allowing you to use the JavaScript API methods to control a ASPNetVideo object.
e.g. videoObject = ASPNetMedia.Video(“WindowsMedia1”) |
JavaScript API
To use the API functions, you must call them using the object returned by the Accessor function.
e.g. ASPNetMedia.Video(“WindowsMedia1”).PlayMedia()
PlayMedia ([URL]) |
Commands the video to start playing. The optional URL parameter allow you to change the video file to be played. |
LoadMedia(URL) |
Changes the video media that will be played back. The parameter URL should be the url of the new target video file. |
PauseMedia() |
Pauses the video. Playback can be resumed by using the PlayMedia function. |
StopMedia() |
Stops the video and rewinds it.
|
Mute() |
Toggles the muted (silenced) state of the video. |
GetVolume() |
Returns the volume setting of the video player as an integer between 0 and 100. |
SetVolume(VolumeLevel) |
Sets the volume of the video player. VolumeLevel must be an integer between 0 and 100. |
GetPosition() |
Returns the position of the video play-head in seconds. |
GetDuration() |
Returns the duration of the video in seconds. |
SetPosition (TimeInSeconds) |
Sets the position of the video play-head in seconds. Note that the video play-head cannot move to a section of the video which has not yet been downloaded. |
FastForward([SeekRate]) |
Starts the video fast-forwarding. The optional seek rate parameter allows you to use an integer to specify the relative speed of the fast-forward.
The fast-forward behavior can be canceled using the FastForwardStop method.
NOT REAL PLAYER
NOT FULL COMPATIBLE WITH CURRENT VERSION OF FIRE FOX for WINDOWS MEDIA PLAYER |
FastForwardStop() |
Stops the video fast-forwarding.
NOT REAL PLAYER
NOT REAL PLAYER
NOT FULL COMPATIBLE WITH CURRENT VERSION OF FIRE FOX for WINDOWS MEDIA PLAYER |
FastReverse([SeekRate]) |
Starts the video rewinding. The optional seek rate parameter allows you to use an integer to specify the relative speed of the fast-reverse.
The fast- reverse behavior can be canceled using the FastReverseStop method.
NOT REAL PLAYER
NOT REAL PLAYER
NOT FULL COMPATIBLE WITH CURRENT VERSION OF FIRE FOX for WINDOWS MEDIA PLAYER |
FastReverseStop() |
Stops the video fast-reversing.
NOT REAL PLAYER
NOT REAL PLAYER
NOT FULL COMPATIBLE WITH CURRENT VERSION OF FIRE FOX for WINDOWS MEDIA PLAYER |
JavaScript Events
To use ASPNetVideo Events you assign them a callback function.
e.g.
ASPNetMedia.Video(“WindowsMedia1”). OnPause = function(object, position){
alert(‘paused’);
}
The parameter object send in the ASPNetVideo API object for convenience.
The parameter position returns the video’s play-head position in seconds.
OnStop (object, position) |
Called when the video is stopped. |
OnPause (object, position) |
Called when the video is paused. |
OnPlay (object, position) |
Called when the video starts playing. |
OnFinish (object, position) |
Called when the video finishes. |
OnStartBuffer (object) |
Called when the video starts buffering. |
OnReady (object) |
Called when the video stops buffering and is ready to play. |
OnStartSeek (object, position) |
Called when the video starts fast-forwarding or fast-reversing. |
OnStopSeek (object, position) |
Called when the video stops fast-forwarding or fast-reversing. |
OnProgress (object, position) |
Called regularly while the video is playing as a heartbeat function. |
OnSeek (object, position) |
Called regularly while the video is fast-forwarding or fast-reversing as a heartbeat function. |
|