Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Version History

Version #DescriptionFile

1.1.0

(Current)

Volume control functions and bugfixes.http://demo-player.frequency.com/_assets/interface.js
1.0.0This is the first version of the Frequency player that supports VMAP, VPAID, VAST 2.0, VAST 3.0 advertising standards and MP4 and HLS video formats.

http://demo-player.frequency.com/_assets/interface.js

   

...

options - additional options (optional) eg. adsConfig (Frequency.Player.AdsConfig)

Returns:

void

 

setVolume

Code Block
setVolume(volume:Number)

Sets player volume.

 Parameters:

 volume - New volume value for player. Value must be in range 0-100 

Returns:

void 

getVolume

Code Block
getVolume()

Returns current volume for the player.

Parameters:

 none

Returns:

 Number

addEventListener

Code Block
addEventListener(event:String, callback:String)

...

The Player Video class is a video data structure used for video player initialization along with video playback.


Player properties

version - current player version

Player Ads Configuration

Code Block
Frequency.Player.AdsConfig

...

Event

Type

Description

onError

Function

An error occurred.

onReady

Function

JS player ready for actions.

onMediaReady

Function

Media player ready.

onStateChange

Function

Player state has changed.

onProgress

Function

Players progress changed.

onVastEventFunctionVast Ad Event occurred.
onVolumeChangeFunctionPlayer volume has changed

Video Playback States

State

Value

Description

UNKNOWN

undefined

Player state is unknown, player setup process did not finished.

UNSTARTED

-1

Player media ready but pending play action.

ENDED

0

Player finished playback.

PLAYING

1

Player is currently playing a video.

PAUSED

2

Player paused.

BUFFERING

3

Player is buffering.

LOCKED

4

Player locked by internal action.

 

SEEKING5Played seeking.

...

  1.  Initialize the Player.

    Code Block
    var player = new Frequency.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.   

    Code Block
    var player = new Frequency.Player(
                    undefined, {
                       video: {
                          url: 'clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
                          startPosition: 50,
                          autoplay: true,
                          adsConfig: {
                              adTagUrl: '/some/url/to/vast.xml',
                              adCuePoints: [12345, 23456, 34567]
                          }
                       },
                       events: {
                          onStateChange: function(state) {
                          },
                          onProgress: function(currentTime) {
                          },
                          onVolumeChange: function(volume) {
                          },(...)
                       } 
                    }      
                 );
    
    
  2. Add player event listeners.

    Code Block
    player.addEventListener(Frequency.Player.Events.onError, errorHandler);
    player.addEventListener(Frequency.Player.Events.onProgress, progressHandler);
  3. Play the video.

    Code Block
    player.loadVideo('http://videoURL.mp4);
    player.play();

    Here is a demonstration of the video playback and event handling in a typical HTML5 playback scenario:


...