Assets JavaScript APIs (Player V2 Deprecated)

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

Assets Properties

Note: This software is deprecated. Use the latest version.

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

Properties Description
getLineup

Get an array of objects describing the current channel.

Type: array

Return Values: channel description

getTitle

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

Type: String

Return Values: channel title | video title

Examples: My Snowboarding Channel

getCanRateCurrentItem

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

getCurrentItem

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

getCurrentItemAverageRating

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

getCurrentItemDescription

Get the description of the current video.

Type: string

Return Value: text describing the current asset.

Example: "snowboarding competition"

getCurrentItemRatings

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

getCurrentItemTitle

Get the title of the current video.

Type: string

Return Value: alphanumeric

Example: "X Games"

getTotalTime

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
incrementCurrentItemRating(rating)

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

Play the current video.

Related Information

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

Was this article helpful?