The Leader in Secure Video
Delivery Software
|
You can affect Clipstream® Java applets using Java methods and Java functions. This is a list of all employed methods.
All examples assume that the name of the applet (object) is Clipstream Video.
example with syntax:
| Method | Description |
| stop_video | Stop the video stream |
| play_video | Start the video stream |
| pause_video | Pause the video stream |
| toggle_video | Play/stop - if stopped will play, if playing will stop |
| toggle_pause_video | Play/pause - if paused will play, if playing will pause |
| get_currentstreamurl | Returns the name of the current video stream |
| set_callbackOnPlay | Set the JavaScript method to call on play |
| set_callbackOnTimer | Set the JavaScript method to call on timer |
| set_callbackOnStop | Set the JavaScript method to call on stop |
| get_pos | Returns the current position in the video stream (in milliseconds) |
| seek_video | Set the video stream to value specified (in milliseconds) |
| seek_video_percentage | Set the video stream to value specified (in percent) |
| toggle_audio (boolean) | Toggle the audio on or off |
| toggle_audio | Toggle the audio on and off |
| get_length | Returns current clip's length (in milliseconds) |
| get_status | Returns current clip's status |
| get_audio | Get the current audio status |
Stop the video stream
Prototype
void stop_video(void)Parameters
NoneReturns
NothingDescription
Call this function to stop the video stream. Same as pressing the stop button on the applet control panel.Example
document.videoclipstream.stop_audio();
Start the video stream
Prototype
void play_video(int vidNum, String newPlayFunction);Parameters
vidNum - integer value of which video to play from parameter list, 0 for auto detect.
newPlayFunction - a string with the name of the JavaScript function to call on play.Returns
NothingDescription
Call this function to start the video stream. Same as pressing the play button on the applet controll panel.Example
document.videoclipstream.play_video(0,null);
Pause the video stream
Prototype
void pause_video(void);Parameters
NoneReturns
NothingDescription
Call this function to pause the video stream. Same as pressing the pause button on the applet.Example
document.videoclipstream.pause_video();
Play/stop - if stopped will play, if playing will stop
Prototype
void toggle_video(void);Parameters
NoneReturns
NothingDescription
This function will start the video if the applet is stopped or stop the video if it's playing. Useful if you want one button outside the applet to start and stop the video.Example
document.videoclipstream.toggle_video();
Play/pause - if paused will play, if playing will pause
Prototype
void toggle_pause_video(void);Parameters
NoneReturns
NothingDescription
This function will start the video if the applet is stopped or pause the video if it's playing. Useful if you want one button outside the applet to start and pause the video.Example
document.videoclipstream.toggle_video_pause();
Returns the name of the current video stream
Prototype
String get_currentstreamurl(void);Parameters
NoneReturns
A string with the URL of the current video fileDescription
Use this function to get the name of the file being played (returned as a URL)Example
var currentFile = document.videoclipstream.get_currentstreamurl();
Set the JavaScript method to call on play
Prototype
void set_callbackOnPlay(String newFunction);Parameters
newFunction - a string with the name of the new JavaScript function to call on play.Returns
NothingDescription
Overrides the value specified in the applet parameter CallbackOnPlay. This function will be called by the applet when playback is startedExample
document.videoclipstream.set_callbackOnPlay("playFunc()");
Set the JavaScript method to call on timer
Prototype
void set_callbackOnTimer(String timerFunction, double x);Parameters
timerFunction - JavaScript function to call when timer is triggered
x - time in seconds when to trigger the callback function specified by timerFunctionReturns
NothingDescription
You can start a timer and tell the applet to call a specific function when the timer is triggered.Example
document.videoclipstream.set_callbackOnTimer("timerFunction()", 30);
Set the JavaScript method to call on stop
Prototype
void set_callbackOnStop(String stopFunction);Parameters
stopFunction - a string with the name of the new JavaScript function to call.Returns
NothingDescription
This function will be called by the applet when playback is stopped.Example
document.videoclipstream.set_callbackOnStop("stopFunc()");
Returns the current position in the video stream (in milliseconds)
Prototype
int get_pos(void);Parameters
NoneReturns
Integer value specifying the current position of the video stream in milliseconds.Description
Call this function to determine current position.Example
var currentPosition = document.videoclipstream.get_pos();
Set the video stream to value specified (in milliseconds)
Prototype
void seek_video(int newPos);Parameters
newPos - integer value specifying the new position of the video stream (in milliseconds).Returns
NothingDescription: Used to set the playback position of the current video stream in milliseconds.
Example
document.videoclipstream.seek_video(8000);
Set the video stream to value specified (in percent)
Prototype
void seek_video(double newPercent);Parameters
newPercent - value specifying the new position of the video stream (in percent). Valid values range from 0 to 1.Returns
NothingDescription
Used to set the playback position of the current video stream as a percentage.Example
document.videoclipstream.seek_video_percentage(0.5);
Toggle the audio on or off
Prototype
void toggle_audio(bool boolValue);Parameters
boolValue - true or false, true will enable audio, false will disable.Returns
NothingDescription
Used to turn the audio specifically (as opposed to either) on or off during video playback.Example
document.videoclipstream.toggle_audio(true);
Toggle the audio on and off
Prototype
void toggle_audio(void);Parameters
NoneReturns
NothingDescription
Used to toggle the audio either on or off during video playback. If audio is enabled, will disable. If disabled, will enable.Example
document.videoclipstream.toggle_audio();
Top
get_audio
Get the current status of the audio stream.
Prototype
bool get_audio();Parameters
NoneReturns
A boolean value, true or false.Description
Will return the current status of the audio stream, true means the audio is playing, false if it's disabled.Example
var audioStatus = document.videoclipstream.get_audio();
get_status
Get the current clip's status.
Parameters
NoneReturns
play/pause/idle
Description
Will return the status of the stream.
get_length
Get the current clip's length.
Parameters
NoneReturns
Integer, in milliseconds.Description
Returns the length of the stream.
