Namespaces

Classes

MessageBus
Player

Namespaces

OO
ERROR
Represents the Ooyala V3 Player Errors.
API
Represents the OO.ERROR.API Ooyala V3 Player Errors.
SAS
Represents the OO.ERROR.API.SAS Ooyala V3 Player Errors.
PLAYBACK
Represents the OO.ERROR.PLAYBACK Ooyala V3 Player Errors.
EVENTS
Represents the Ooyala Player events.
STATE
Represents the Ooyala Player run-time states.

Events

ADS_CLICKED

This event is triggered when an ad has been clicked.

Compatibility:

HTML5

ADS_ERROR

This event is triggered when an error has occurred with an ad.

Compatibility:

HTML5

ADS_PLAYED

A set of ads have been played. Depending on the context, the handler is called with:
  • The duration of the ad.
  • The ID of the item to play.
Compatibility:

Flash

AUTH_TOKEN_CHANGED

An AUTH_TOKEN_CHANGED event is triggered when an authorization token is issued by the Player Authorization API.
For example, in device registration, an authorization token is issued, as described in Device Registration. The handler is called with a new value for the authorization token.

Compatibility:

Flash

AUTHORIZATION_FETCHED

Playback was authorized. The handler is called with an object containing the entire SAS response, and includes the value of video_bitrate.

For more information see Video Bit Rate.

Compatibility:

HTML5

BITRATE_CHANGED

The currently playing bitrate has changed. The handler is called with the video bitrate.

For more information see Video Bit Rate.

Compatibility:

Flash

BITRATE_INFO_AVAILABLE

Lists the available bitrate information. The handler is called with an object containing the entire SAS response, and includes:
  • The bitrate qualities.
  • The bitrates.
  • The target bitrate's quality.
  • The target bitrate.

For more information see Video Bit Rate.

Compatibility:

Flash

BUFFERED

Play resumes because the player has completed buffering. The handler is called with the URL of the stream.

Compatibility:

HTML5

BUFFERING

The player is buffering the data stream.

Compatibility:

HTML5, Flash

CHANGE_VOLUME

A request to change volume has been made. The handler is called with the volume level.

Compatibility:

HTML5, Flash

CONTENT_TREE_FETCHED

A content tree was fetched. The handler is called with a JSON object that represents the content data for the current asset.

Compatibility:

HTML5, Flash

Analytics:

Records a display event. For more information see Displays, Plays, and Play Starts.

CONTROLS_HIDDEN

Controls are hidden.

Compatibility:

HTML5

CONTROLS_SHOWN

Controls are shown.

Compatibility:

HTML5

DESTROY

The player is currently being destroyed, and anything created by your module must also be deleted. After the destruction is complete, there is nothing left to send an event. Any plugin that creates or has initialized any long-living logic should listen to this event and clean up that logic.

Compatibility:

HTML5, Flash

DOWNLOADING

The player is downloading content (it can play while downloading). The handler is called with the time of the event.

Compatibility:

HTML5

EMBED_CODE_CHANGED

The player's embed code has changed. The handler is called with two parameters:
  • The ID (embed code) of the asset.
  • The options JSON object.
Compatibility:

HTML5, Flash

ERROR

An error has occurred. The handler is called with a JSON object that always includes an error code field, and may also include other error-specific fields.

Compatibility:

HTML5, Flash

FULLSCREEN_CHANGED

The fullscreen state has changed. Depending on the context, the handler is called with:
  • isFullscreen is set to true or false.
  • isFullscreen and paused are each set to true or false.
Compatibility:

HTML5, Flash

GUID_SET

The GUID has been set. The handler is called with the GUID.

This event notifies plugin or page developers that a unique ID has been either generated or loaded for the current user's browser. This is useful for analytics.

In HTML5, Flash, and Chromecast environments, a unique user is identified by local storage or a cookie.

To generate the GUID, Flash players use the timestamp indicating when the GUID is generated, and append random data to it. The string is then converted to base64.

To generate the GUID, HTML5 players use the current time, browser information, and random data and hash it and convert it to base64.

Within the same browser on the desktop, once a GUID is set by one platform it is used for both platforms for the user. If a user clears their browser cache, that user's (device's) ID will be regenerated the next time they watch video. Incognito modes will track a user for a single session, but once the browser is closed the GUID is erased.

For more information, see unique user Glossary.

Compatibility:

HTML5

INITIAL_PLAY

Play has been called for the first time.

Compatibility:

HTML5

METADATA_FETCHED

The metadata, which is typically set in Backlot, has been retrieved. The handler is called with the JSON object containing all metadata associated with the current asset. The metadata includes page-level, asset-level, player-level, and account-level metadata, in addition to metadata specific to 3rd party plugins. This is typically used for ad and anlytics plugins, but can be used wherever you need specific logic based on the asset type.

Compatibility:

HTML5, Flash

PAGE_UNLOAD_REQUESTED

The window, document, and associated resources are being unloaded. The handler is called with true if a page unload has been requested, false otherwise. This event may be required since some browsers perform asynchronous page loading while the current page is still active, meaning that the end user loads a page with the Ooyala player, plays an asset, then redirects the page to a new URL they have specified. Some browsers will start loading the new data while still displaying the player, which will result in an error since the networking has already been reset. To prevent such false errors, listen to this event and ignore any errors raised after such actions have occurred.

Compatibility:

HTML5

PAUSE

A player pause has been requested.

Compatibility:

HTML5, Flash

PAUSED

The player was paused.

Compatibility:

HTML5, Flash

PLAY

A playback request has been made.

Compatibility:

HTML5, Flash

PLAYBACK_READY

The player has indicated that it is in a playback-ready state. All preparations are complete, and the player is ready to receive playback commands such as play, seek, and so on. The default UI shows the Play button, displaying the non-clickable spinner before this point.

Compatibility:

HTML5, Flash

PLAYED

The video and asset were played. The handler is called with the arguments that were passed.

Compatibility:

Flash

PLAYER_CREATED

A player was created. This is the first event that is sent after player creation. This event provides the opportunity for any other modules to perform their own initialization. The handler is called with the query string parameters. The DOM has been created at this point, and plugins may make changes or additions to the DOM.

Compatibility:

HTML5, Flash

PLAYHEAD_TIME_CHANGED

The playhead time changed. The handler is called with the following arguments:
  • The current time.
  • The duration.
  • The name of the buffer.
  • The seek range.
Compatibility:

HTML5, Flash

Analytics:

The first event is video start. Other instances of the event feed the % completed data points.

For more information, see Displays, Plays, and Play Starts.

SEEK

A request to perform a seek has occurred. The playhead is requested to move to a specific location, specified in milliseconds. The handler is called with the position to which to seek.

Compatibility:

HTML5

SEEKED

The player has finished seeking to the requested position.

Compatibility:

HTML5

SET_EMBED_CODE

An attempt has been made to set the embed code. If you are developing a plugin, reset the internal state since the player is switching to a new asset. Depending on the context, the handler is called with:
  • The ID (embed code) of the asset.
  • The ID (embed code) of the asset, with options.
Compatibility:

HTML5, Flash

SIZE_CHANGED

The screen size has changed. This event can also be triggered by a screen orientation change for handheld devices. Depending on the context, the handler is called with:
  • The width of the player.
  • The height of the player.
Compatibility:

HTML5

VOLUME_CHANGED

The volume has changed. The handler is called with the current volume, which has a value between 0 and 1, inclusive.

Compatibility:

HTML5, Flash

WILL_CHANGE_FULLSCREEN

This event is triggered before a change is made to the full screen setting of the player. The handler is called with true if the full screen setting will be enabled, and is called with false if the full screen setting will be disabled.
Compatibility:

HTML5

WILL_PLAY_ADS

This event is triggered before an ad is played. Depending on the context, the handler is called with:
  • The duration of the ad.
  • The ID of the ad.
Compatibility:

HTML5, Flash

Analytics:

Ad Analytics AD_IMPRESSION event.

WILL_SHOW_COMPANION_ADS

This event is triggered before the companion ads are shown. Companion ads are displayed on a customer page and are not displayed in the player. This event notifies the page handler to display the specified ad, and is the only means by which companion ads can appear. If the page does not handle this event, companion ads will not appear. Depending on the context, the handler is called with:
  • The ID of all companion ads.
  • The ID of a single companion ad.
Compatibility:

HTML5

Analytics:

Ad Analytics AD_IMPRESSION event.