Browsers & Device Support
Frequency's player is supported on the following browsers and devices.
Players & Formats
The Player class plays videos from HTML5 web apps. The Player supports advertisement playback and beaconing along with standalone video playback transparently.
|String or DOMNode||Node selector or DOMNode the player will be inserted into.|
|url||String||The video file url.||-|
|startPosition||Number||The video start position||0|
|autoplay||Boolean||Autoplay the video after it is loaded.|
|hls||Boolean||Enables MP4 HLS player||false|
Constructs a Player object for video playback.
video - The Frequency.Player.Video object containing the video url, playback start position along with whether to auto play the video once loaded.
events - The Frequency.Player.Events object to bind playback event listeners.
An initialized Player object.
Plays the currently loaded video.
Pauses the currently playing video.
Seeks to a specified time in the video.
time - The time position (in seconds) in the video to jump to.
Returns the duration of the currently playing video in seconds.
Number - The video duration in seconds.
Returns the video player's current play state.
Number - The number representing the video playback state. (see video states).
Returns the lapsed time since the video start in seconds.
Number - The lapsed video playback time in seconds.
Loads the video url specified by the url string. This does not auto play the video. The onMediaReady event would need to be monitored along with a subsequent video play() method call to cause the loaded video to play.
url - The url of the video to load.
options - additional options (optional) eg. adsConfig (Frequency.Player.AdsConfig)
Adds a listener function for the specified event.
event - The event to register for listening. (See Player events)
callback - The event handler method of code block.
Removes a listener function for the specified event.
event - The listening event. (See Player events)
callback - The event handler method or code block.
Player Video Class
The Player Video class is a video data structure used for video player initialization along with video playback.
Player Ads Configuration
VAST document URL
array of cue points (seconds or "preroll", "postroll")
Player Events Class
The Player Events class defines all the events that listeners can register on.
An error occurred.
JS player ready for actions.
Media player ready.
Player state has changed.
Players progress changed.
|onVastEvent||Function||Vast Ad Event occurred.|
Video Playback States
Player state is unknown, player setup process did not finished.
Player media ready but pending play action.
Player finished playback.
Player is currently playing a video.
Player is buffering.
Player locked by internal action.
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