Customizing Assets for HTML5 Player V3 Using JavaScript

Customize assets using the Player V3 message bus.

The Ooyala Player exposes events for assets with all events prefixed with OO.EVENTS. Supported JavaScript methods for Player are shown in the following table.
Table 1. JavaScript Methods for Assets
get Methods set Methods other Methods
  • getBufferLength
  • getCurrentItem
  • getCurrentItemDescription
  • getCurrentItemEmbedCode
  • getCurrentItemTitle
  • getDescription
  • getDuration
  • getEmbedCode
  • getItem
  • getLiveTime
  • getPlayheadTime
  • getTitle
  • getTotalTime
  • setPlayheadTime
  • setEmbedCode
  • setCurrentItemEmbedCode
  • play
  • playMovie
  • pause
  • pauseMovie
  • seek
Note: Currently, Player does not support the Player getActivePanel method.

Events associated with Player assets are described in the following table.

Table 2. Asset Events
Event Published
WILL_FETCH_ADS Before fetching ad information from the ad manager.
WILL_PLAY_ADS When starting to play ads, second parameter is the details of the ad being played.
ADS_PLAYED After the ad was complete, second parameter is the details of the ad being played.
WILL_SHOW_COMPANION_ADS Before displaying companion ads.
SET_EMBED_CODE Before the embed_code is changed.
EMBED_CODE_CHANGED After embed_code was changed.
CONTENT_TREE_FETCHED When content tree is received, second parameter is the new content tree.
METADATA_FETCHED When asset and module metadata is received, second parameter is the metadata.
AUTHORIZATION_FETCHED When authorization for playback is received, includes the actual streaming URLs.
PLAYBACK_READY When player is ready to play.
PLAYHEAD_TIME_CHANGED When seek time has changed.
PLAYING When content playback has started.
PLAY_FAILED If for some reason playback has failed.
PAUSED When content playback has paused.
PLAYED When content playback has finished (including all the ads).
Note: The Ooyala Player does not include activePanelChanged, ratingsApiReady, and relatedMediaReady events. Although the apiReady, playerCreated, loadComplete, and playerEmbedded events are not provided, you can use the PLAYBACK_READY Event for equivalent functionality.

Was this article helpful?