Page tree

Versions Compared

Key

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

...

The sequence to using the Frequency JavaScript Player is as follows:

  1.  Initialize the Player.

    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.   

    var player = new Frequency.Player(
       undefined, {
    video: {
    url: 'clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
    startPosition: 50 
       
    )
     
  2. Add player event listeners.

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

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

Player initialization

Code Block
languagejs
titleExample
firstline1
linenumberstrue
new Frequency.Player(
        undefined, {
            video: {
                url: 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4',
                startPosition: 50,
                autoplay: true
            },
            events: {
                onStateChange: function (state) {
                },
                onProgress: function (currentTime) {
                },(...)
            }
        }
    );

...