About the Player V4 JavaScript API

This topic provides an overview of key concepts for the Player V4 JavaScript API.

API Reference

See apidocs.ooyala.com for the Player V4 JavaScript API Reference.

Player V4 API Functions

Once you can instantiate a new Player V4 object:
new Player()
you can manage the player instance using the functions described at http://apidocs.ooyala.com/player_v4_js/OO.Player.html.

Player V4 States

A running player undergoes various states during its lifecycle. For example:
  • The video and metadata are loading into the player.
  • Video playback is ready to begin.
  • The player is currently playing video content.
  • The player is currently paused (after playback had begun).
  • The player is buffering - playback has stopped because it does not have enough video data to continue and is downloading more.
  • The player has encountered an error that prevents playback of the video.
The current player state determines which functionality is available in the current context. For example, the play operation is available when the player is in the ready state, and the pause operation is available when it is in the playing state. State changes are triggered by events (see below). For a list of player states, see http://apidocs.ooyala.com/player_v4_js/OO.STATE.html.

Player V4 Events

Player run-time events can be triggered in either of the following ways:
  • manually by end user actions (for example, clicking the play or pause button)
  • programmatically via an API call
Here are some examples of common playback events:
  • playback has started
  • playback has completed
  • an ad has started playing
  • one or more ads have completed playing
  • an error has occurred
Events can trigger changes in the player state. For example, a user clicking the play button fires the "play has started" event and changes the player state to playing. For a list of player events, see http://apidocs.ooyala.com/player_v4_js/OO.EVENTS.html.

Was this article helpful?