Initialize the Player.
The player can be initialized with video and listener bindings so that it is one-shot ready to play or the player object can be constructed and setting the video to play and event listeners in subsequent method calls.
Add player event listeners.
Play the video.
Here is a demonstration of the video playback and event handling in a typical HTML5 playback scenario:
Frequency Player Demo
Player Video Class
|String or DOMNode||Node selector or DOMNode the player will be inserted into.|
|String||Video file URL.|
|Number||Video start position.||0|
|Boolean||Player will/will not start playing right after loading video file.||false|
|Function||An error occured.|
|Function||JS player ready for actions.|
|Function||Media player ready.|
|Function||Player state has changed.|
|Function||Players progress changed.|
|undefined||Player state is unknown, player setup process did not finished.|
|-1||Player media ready but pending play action.|
|0||Player finished playback.|
|1||Player is currently playing a video.|
|3||Player is buffering.|
|4||Player locked by internal action.|
|Void||Plays the currently loaded video.|
|Void||Pauses the currently playing video.|
|Void||Seeks to a specified |
|Number||Returns the duration of the currently playing video (in seconds).|
|Number||Returns video players current state.|
|Number||Returns the elapsed time since the video start (in seconds).|
|Void||Loads video url specified by |
|Void||Adds a listener function for the specified |
|Void||Removes a listener function for the specified |