Assets ActionScript APIs (Player V2 Deprecated)
Assets ActionScript APIs can be used to handle ratings, videos (play/pause, describe), and channels.
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.
The following table describes all the ActionScript properties that are associated with assets.
Specifies whether the current computer is allowed to rate the current item. This will be false if they have rated the current item before.
Return Values: true | false
Returns the average rating given to the item.
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.
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.
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.
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.
Returns an array of objects describing the current channel.
Get the title of the current channel or of the video if no channel is specified.
Return Value: alphanumeric string
Example: "X Games"
Get the length of the active video (in seconds with millisecond accuracy).
The following table describes all the ActionScript methods that are associated with assets.
Increments the rating for the current item. If this computer has rated this item before, calling this function will have no effect.
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.
The following list provides links to Backlot documentation that provides some general information about assets.