Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.76 KB

api.md

File metadata and controls

69 lines (43 loc) · 2.76 KB

Eagle Player API

Methods and events are available from skins, plugins and externally from IFrame API.

Methods

To use methods just call them as regular methods of player object: player.play();

Common

  • reload - reloads video with another ID. Pass it to the parameter.

Metadata

  • getData - gets video metadata. Use parameter as a key of metadata. Some of possible metadata keys are name, duration.
  • getState - gets current video playback state. States may be play, pause or other.

Playback

  • play - starts video playback. Works everytime even if video is paused or stopped.
  • pause - pauses video playback.
  • stop - stops video playback.
  • position - rewind current video position to second passed as argument

Appearance

  • hideSkin - hides the skin
  • showSkin - shows the skin back again after hiding

Sizes

  • getWidth and getHeight - returns player dimensions as they seen in pixels
  • getVideoWidth and getVideoHeight - returns video dimensions as they streamed
  • getDisplayVideoWidth and getDisplayVideoHeight - returns video dimensions as they seen on display

Audio

  • volume - sets volume. Pass float 0..1 as parameter
  • mute - mutes sound
  • unmute - unmutes sound

Events

To use events just use on subscription similar to JQuery. First parameter will be the event name and the second will be optional parameter depending on event type.

Common events

  • start - player is fully initialized and ready to work
  • reload - when player reloads video with another

Playback events

  • play - triggered when player is about to start playing content. It may happen when user clicks on play button.
  • playing - triggered just after the main video is started to play. The difference here with play event is this method ensures that player started to play video and not advertisement/other possible media.
  • pause - when user pauses the video playback
  • stop - when video playback is stopped (fully played or externally called by API)
  • timeupdate - fired frequently during video playback. Passed parameter is current position in milliseconds
  • seek - when user performs seek on a video. Passed parameter is a millisecond to seek for.
  • loaded_position - buffered length event in milliseconds of last loaded moment. Triggered frequently during buffering process.

Player size change

  • resize - when size of player possibly changed.
  • fullscreen - when player comes to fullscreen or from fullscreen. Passes boolean parameter, true indicates that fullscreen is enabled

Advertisement

  • advertisement_state - when player starts, finishes advertisement or in any other significant advertisement events provided by Ad plugin. Will never be triggered if no Ad plugin enabled (no advertisement)