Assets JavaScript APIs (Player V2 Deprecated)

Assets ActionScript APIs can be used to handle ratings, videos (play/pause, describe), and channels.

Assets Properties

Important: Ooyala Player V2 is deprecated and is scheduled to be disabled on 2018-01-31. After that date, Player V2 will no longer play your video or audio content. Customers still using Player V2 need to migrate to Player V4 (see Player V4.

The following table describes all the JavaScript properties that are associated with assets.

Properties Description

Get an array of objects describing the current channel.

Type: array

Return Values: channel description


Get the title of the current channel or video if no channel.

Type: String

Return Values: channel title | video title

Examples: My Snowboarding Channel


Returns true when a user is allowed to assign a rating to the current item. Returns false if a user previously used the current device to rate the item.

Type: Boolean

Values: true | false


Get an object describing the current video. The returned Object includes embedCode, title, description, time (play length in seconds), lineup, promo, and hostedAtURL.

Type: Object

Return Values: Item description


Get the average rating given to the item.

Type: integer

Values: numeric average

Example: Given ratings (1, 7, 14, 0, 2, 22, 6, 0), returns 6.5


Get the description of the current video.

Type: string

Return Value: text describing the current asset.

Example: "snowboarding competition"


Get the rating distribution for the current item. This returns an array of integers where each integer represents the number of times a certain rating has been given to the item.

Type: Integer array

Example: [0, 16, 0, 0, 0, 0, 0, 0, 25, 0, 0] indicates that the item has 16 votes for "1" and 25 votes for "8".


Get the title of the current video.

Type: string

Return Value: alphanumeric

Example: "X Games"


Get the length of the active video in seconds.

Type: integer

Return Values: (seconds with millisecond accuracy).

Examples: 5400

Assets Functions

The following table describes all the JavaScript functions that are associated with assets.

Function Description

Increments the rating for the current item. rating can be an integer from 0-10. If this computer has rated this item before, calling this function will have no effect.

Type: Integer

Valid Values: an integer from 0-10.

loadRatingsApi() Loads the Ratings API. The Ratings API should be loaded before calling any of the ratings API functions, like incrementCurrentItemRating() and getCanRateCurrentItem(). The ratingsApiReady event is dispatched when the API is ready for use.
pauseMovie() Pause the current video

Play the current video.

Related Information

The following list provides links to background information on Ooyala Backlot that is related to Player assets.