Assets ActionScript APIs (Player V2 Deprecated)

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

Note: Ooyala Player V2 has been deprecated and is scheduled to be disabled. For details and alternatives, see the OVP Release Notes.

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
canRateCurrentItem

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

currentItemAverageRating

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

currentItemRatings

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

currentItemTitle

Returns the title of the active video.

Bindable

Format: Read-only

Type: String

Return Values: an alphanumeric string representing a video title

Example: "Into the Void"

description

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.

Bindable

Format: Read-only

Type: String

Return Values: alphanumeric description of asset

Example: "Season 22 Opening Game"

item

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

Bindable

Format: Read-only

Type: Object

lineup

Returns an array of objects describing the current channel.

Bindable

Format: Read-only

Type: Array

title

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

Bindable

Format: Read-only.

Type: String

Return Value: alphanumeric string

Example: "X Games"

totalTime

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

Bindable

Format: Read-only.

Type: Integer

Example: 5400

Assets Functions

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

Function Description
incrementCurrentItemRating(rating)

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.
playMovie()

Play the current video.

Related Information

The following list provides links to Backlot documentation that provides some general information about assets.

해당 내용이 도움 되었습니까?