Assets ActionScript APIs (Player V2 Deprecated)

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

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.

When you upload a video to Ooyala, Ooyala automatically transcodes it using the settings specified for your account and makes the videos available for playback through your player. We recommend that you upload videos to Ooyala in H.264, but we also support many commonly used codecs (MPEG-1, MPEG-2, MPEG-4, VP6, H.264, H.263, WMV/WMA, and MJPEG). The following APIs enable you to control aspects of your video or audio assets such as controlling what computers can rate an asset and collecting information about the video such as title and duration.

Assets Properties

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

Properties Description

Specifies whether the current computer is allowed to rate the current item. This will be false if they have rated the current item before.

Type: Boolean

Return Values: true | false


Returns the average rating given to the item.

Type: Integer

Return Value: average of numbers

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


Returns the rating distribution for the current item.

Type: Integer

Return Value: an array of integers where each integer represents the number of times a certain rating has been given to the item.

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".


Returns the title of the active video.


Format: Read-only

Type: String

Return Values: an alphanumeric string representing a video title

Example: "Into the Void"


Returns the description of the player source. Typically this is the description entered for a video or audio asset in Backlot. This API allows you to retrieve the entered description that was set in the Backlot Manage > Details tab or equivalent manual setting.


Format: Read-only

Type: String

Return Values: alphanumeric description of asset

Example: "Season 22 Opening Game"


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


Format: Read-only

Type: Object


Returns an array of objects describing the current channel.


Format: Read-only

Type: Array


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


Format: Read-only.

Type: String

Return Value: alphanumeric string

Example: "X Games"


Get the length of the active video (in seconds with millisecond accuracy).


Format: Read-only.

Type: Integer

Example: 5400

Assets Functions

The following table describes all the ActionScript methods that are associated with assets.

Function Description

Increments the rating for the current item. If this computer has rated this item before, calling this function will have no effect.

Type: Integer

Parameter: rating

Return 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 Backlot documentation that provides some general information about assets.