ActionScript API Methods

Method Summary


public addCuePoints ( titleId: Number, cuePoints: Array ): Boolean
public addEventListener ( event: String, listener: Object[, method: String]): Boolean
public clearCodeCuePoints ( titleId: Number): Boolean
public closeBrightcoveMenuPage ( ): Void
public closeSynchedBanner ( ): Void
public colorBackground ( color: Number ): Boolean
public enableAdFormats ( ): Void
public enableOverlayScreen ( screen: String , enable: Boolean ): Void
public endExternalAd ( ): Void
public fetchCatalog ( catalogId: Number , depth: Number ): Void
public fetchLineupById ( lineupId: Number ): Void
public fetchLineupByReferenceId ( lineupReferenceId: String ): Void
public fetchLineupsForCategory ( categoryId: Number ): Void
public fetchTitleById ( titleId: Number ): Void
public fetchTitleByReferenceId ( titleReferenceId: String ): Void
public getAffiliateId ( ): Number
public getCatalog ( catalogId: Number ): Object
public getCatalogIds ( ): Array
public getCuePoints ( titleId: Number ): Object
public getCurrentTitle ( ): Object
public getEnabledAdFormats ( ): Array
public getFeaturedLineup ( ): Object
public getFeaturedLineupId ( ): Number
public getFeaturedTitle ( ): Object
public getFeaturedTitleId ( ): Number
public getLineupById ( lineupId: Number ): Object
public getLineupByReferenceId ( lineupReferenceId: String ): Object
public getLineupsForCategory ( categoryId: Number ): Array
public getLink ( ): String
public getPlayerId ( ): Number
public getPlayerLineupIds ( ): Array
public getPlayerLineups ( ): Array
public getPlayerURL ( ): String
public getPlayerValue ( key: String ): String
public getPublisherId ( ): Number
public getTitleById ( titleId: Number ): Object
public getTitleByReferenceId ( titleReferenceId: String ): Object
public getVideoBytesLoaded ( ): Number
public getVideoBytesTotal ( ): Number
public getVideoDuration ( [format: Boolean] )
public getVideoPosition ( [format: Boolean] )
public getVolume ( ): Number
public isMenuOpen ( ): Boolean
public isMenuPageOpen ( ): Boolean
public isMuted ( ): Boolean
public isPlaying ( ): Boolean
public loadBackground( file: String ): Boolean
public loadCSS ( css: String ): Void
public loadImage ( imageIndex: Number , file: String [, clickThru: String] ): Boolean
public loadPlayer ( config: Object ): Void
public loadTitleById ( titleId: Number [, playMode: String] ): Void
public loadTitleByReferenceId ( titleReferenceId: String [, playMode: String] ): Void
public logImageEvent ( event: String , imageName: String ): Boolean
public logLineupEvent ( event: String , lineupId: Number ): Boolean
public logPlayerEvent ( event: String ): Boolean
public logSharingEvent ( event: String , titleId: Number ): Boolean
public logTitleEvent ( event: String , titleId: Number ): Boolean
public pauseAd ( [pause: Boolean] ): Void
public pauseVideo ( [pause: Boolean] ): Void
public playAd ( adObject: Object ): Void
public purgeAllCatalogs ( ): Void
public purgeAllCategoryLineups ( ): Void
public purgeCatalog ( catalogId: Number ): Boolean
public purgeLineupsForCategory ( categoryId: Number ): Boolean
public removeCodeCuePointsAtTime ( titleId: Number , time: Number ): Boolean
public removeEventListener ( event: String , listener: Object ): Boolean
public searchTitles ( searchString: String [, categories: Array [, tags: Array [, pageSize: Number [, sort: String
     [, partialStringMatch: Boolean [, andSearchToTagsCategories: Boolean
     [, andTagsToCategories: Boolean]]]]]]] ): Void
public seek ( time: Number ): Void
public selectTitle ( titleId: Number [, lineupId: Number [, playMode: String]] ): Boolean
public setControlsMode ( mode: String ): Void
public setEnabled ( enable: Boolean ): Void
public setLink ( link: String ): Void
public setSize ( width: Number , height: Number ): Void
public setVideoFilter ( filter: Object ): Void
public setVideoPlayerDelegate ( delegate: Function ): Void
public setVolume ( volume: Number ): Void
public shareTitleViaEmail ( fromEmail: String , toEmail: String [, message: String ] ): Boolean
public showBrightcoveMenu ( show: Boolean ): Void
public showBrightcoveMenuPage ( page: String [, videoId: Number] ): Void
public showTitleName ( show: Boolean ): Void
public showVolumeControls ( show: Boolean ): Void
public startVideo ( ): Void
public stopVideo ( ): Void
public synchBannerWithExternal ( adObject: Object ): Void



Method Summary


addCuePoints
public function addCuePoints ( titleId: Number, cuePoints: Array ): Boolean
Adds a set of cuepoints to a specified title. These cuepoints will cause cuePoint events to fire at the times specified, which the user can subscribe to.

Parameters
titleId - VideoDTO id for the title to have cuepoints added to.
cuePoints - An array of objects defining points in time. Each index of the array can either be a number, specifying the time in seconds for the cue, or each index can contain a complex object with time (in seconds), forceStop, type and description properties. Valid values for type can be found in the description for the cuePoint DTO. If the cuePoint is an "ad" type, set the "forceStop" property to true on the cuepoint object to stop video playback.


Returns
Whether the specified title can be found in the current lineups of the player.



addEventListener
public function addEventListener ( event: String, listener: Object [, method: String] ): Boolean
Adds the specified object as a listener for the specified event broadcast by the player. When a listener subscribes to an event in this way, the Brightcove Player will either invoke a method of the same name as the event on the listener object, or, if a method name is provided as the third parameter, the method specified.

Parameters
event - The name of the event to subscribe to.
listener - The object registering to hear the event when it is broadcast by the player.
method - (optional) The name of the method to call as the event handler instead of using the event name.


Returns
Whether the object was successfully added as a listener for the event. This will only return false if the object has been previously added as a listener for the same event.



clearCodeCuePoints
public function clearCodeCuePoints ( titleId: Number ): Boolean
Clears all code cuepoints for a specified title.

Parameters
titleId - VideoDTO id for the title to remove cuepoints from.


Returns
Whether the specified title can be found in the current lineups of the player.



closeBrightcoveMenuPage
function closeBrightcoveMenuPage ( ): Void
Closes any Brightcove menu page, if open.

Parameters
n/a


Returns
n/a



closeSynchedBanner
public function closeSynchedBanner ( ): Void
Closes a synched banner that has been previously opened to render with an external video ad.

Parameters
n/a


Returns
n/a



colorBackground
public function colorBackground ( color: Number ): Boolean
Recolors the player background using the decimal number passed in. The color may only be seen in players that do not have a background image applied.

Parameters
color - The color to apply to the background. This should be a decimal number in the form of 255 (blue) or 0xFF0000 (red).


Returns
Whether the player supports a colored background.



enableAdFormats
public function enableAdFormats ( ): Void
Enables the player to send additional possible formats in ad requests. By default, all players support video ads and overlays. Other players, depending on their design, support additional formats such as synched banners and takeovers. The method takes a variable number of arguments, each of which should be an integer indicating the additional format to support. Current supported formats include:

     0 (video ad)
     1 (overlay)
     2 (synched banner 468x60)
     3 (synched banner 150x150)
     4 (takeover 993x500)
     5 (takeover 917x577)
     6 (banner 468x60)
     7 (banner 150x150)
     8 (takeover 988x511).

Parameters
n/a


Returns
n/a



enableOverlayScreen
public function enableOverlayScreen ( screen: String , enable: Boolean): Void
Enables or disables a specified screen in the video overlay menu. The checkbox labeled "Use video overlay menu" in the Settings tab of the Edit Player window (in the console) must be checked in order to manipulate the display of individual overlay screens. Otherwise, the entire video overlay menu will disabled.

Parameters
screen - The screen in the video overlay to enable or disable. Accepted values are "LOAD", "PAUSE" and "REPLAY."
enable - Whether the specified screen should be enabled or disabled. If true, the screen will be shown as usual. If false, the screen will not display when it is triggered by the player. The default value for all the screens is true.


Returns
n/a



endExternalAd
public function endExternalAd ( ): Void
Informs the player that an external ad has completed playing. The player then resumes playback.

Parameters
n/a


Returns
n/a



fetchCatalog
public function fetchCatalog ( catalogId: Number, depth: Number): Void
Sends call to Brightcove service to retrieve catalog DTO for the id passed in.

Parameters
catalogId - The id for the catalog to retrieve.
depth - The nested level to which to fetch the catalog.


Returns
n/a



fetchLineupById
public function fetchLineupById (lineupId: Number): Void
Sends call to Brightcove service to retrieve lineup DTO for the id passed in.

Parameters
lineupId - The id for the lineup to retrieve.


Returns
n/a



fetchLineupByReferenceId
public function fetchLineupByReferenceId (lineupReferenceId: String): Void
Sends call to Brightcove service to retrieve lineup DTO for the reference id passed in.

Parameters
lineupReferenceId - The reference id for the lineup to retrieve.


Returns
n/a



fetchLineupsForCategory
public function fetchLineupsForCategory (categoryId: Number): Void
Sends call to Brightcove service to retrieve lineup DTOs for the category with its id passed in.

Parameters
categoryId - The id of the category with lineups to retrieve.


Returns
n/a



fetchTitleById
public function fetchTitleById (titleId: Number ): Void
Sends call to Brightcove service to retrieve title DTO for the id passed in.

Parameters
titleId - The id for the title to retrieve.


Returns
n/a



fetchTitleByReferenceId
public function fetchTitleByReferenceId (titleReferenceId: String): Void
Sends call to Brightcove service to retrieve title DTO for the reference id passed in.

Parameters
titleReferenceId - The reference id for the title to retrieve.


Returns
n/a



getAffiliateId
public function getAffiliateId ( ): Number
If the player is syndicated, this method returns the id of the affiliate using this instance of the player. This method is intended to be used with the utility SWF feature, which allows you to specify custom code to be executed with every instance of a player.

Parameters
n/a


Returns
The id of the affiliate which is loading this player instance.



getCatalog
public function getCatalog (catalogId: Number ): Object
Returns the catalog DTO for the id passed in if it is currently loaded in the player.

Parameters
catalogId - The id for the catalog to retrieve.


Returns
A catalog DTO, or null if the catalog has not been loaded in the player.



getCatalogIds
public function getCatalogIds( ): Array
Returns the ids of the currently loaded catalogs in the player.

Parameters
n/a


Returns
An array of catalog ids, or null if no catalog has been loaded in the player.



getCuePoints
public function getCuePoints (titleId: Number): Object
Returns all cuepoints for the specified title.

Parameters
titleId - VideoDTO id for the title to retrieve cuepoints from.


Returns
An array of VideoCuePointDTOs.



getCurrentTitle
public function getCurrentTitle ( ): Object
Returns the title DTO for the title currently in the video window.

Parameters
n/a


Returns
A title DTO.



getEnabledAdFormats
public function getEnabledAdFormats ( ): Array
Returns an array of format IDs supported by the player instance. Current formats include:

     0 (video ad)
     1 (overlay)
     2 (synched banner 468x60)
     3 (synched banner 150x150)
     4 (takeover 993x500)
     5 (takeover 917x577)
     6 (banner 468x60)
     7 (banner 150x150)
     8 (takeover 988x511).

Parameters
n/a


Returns
Array of format IDs.



getFeaturedLineup
public function getFeaturedLineup ( ): Object
Returns the lineup DTO assigned as the featured lineup for the player in the Brightcove console.

Parameters
n/a


Returns
A lineup DTO.



getFeaturedLineupId
public function getFeaturedLineupId ( ): Number
Returns the id of the lineup assigned as the featured lineup for the player in the Brightcove console.

Parameters
n/a


Returns
A lineup id.



getFeaturedTitle
public function getFeaturedTitle ( ): Object
Returns the title DTO assigned as the featured title for the player in the Brightcove console.

Parameters
n/a


Returns
A title DTO.



getFeaturedTitleId
public function getFeaturedTitleId ( ): Number
Returns the id of the title assigned as the featured title for the player in the Brightcove console.

Parameters
n/a


Returns
A title id.



getLineupById
public function getLineupById (lineupId: Number ): Object
Returns the lineup DTO for the id passed in if it is currently loaded in the player.

Parameters
lineupId - The id for the lineup to retrieve.


Returns
A lineup DTO, or null if the lineup has not been loaded in the player.



getLineupByReferenceId
public function getLineupByReferenceId (lineupReferenceId: String ): Object
Returns the lineup DTO for the reference id passed in if it is currently loaded in the player.

Parameters
lineupReferenceId - The reference id for the lineup to retrieve.


Returns
A lineup DTO, or null if the lineup has not been loaded in the player.



getLineupsForCategory
public function getLineupsForCategory (categoryId: Number ): Array
Returns the lineups for the category with its id passed in if they are currently loaded in the player.

Parameters
categoryId - The id of the category with lineups to retrieve.


Returns
An array of lineups, or null if the lineups have not been loaded in the player.



getLink
public function getLink ( ): String
Returns the link to the player specified in the console. Or if a custom link is set using the setLink method, returns the link that was specified.

Parameters
n/a


Returns
A string representing the link to the player.



getPlayerId
public function getPlayerId ( ): String
Returns the id of the player on which the method is called.

Parameters
n/a


Returns
The id of the player.



getPlayerLineupIds
public function getPlayerLineupIds ( ): Array
Returns an array of lineup IDs for all lineups currently loaded into the player, including both the lineups assigned in the console and any lineups loaded at runtime.

Parameters
n/a


Returns
Array of lineup IDs.



getPlayerLineups
public function getPlayerLineups ( ): Array
Returns an array of full lineup DTOs currently loaded into the player.

Parameters
n/a


Returns
Array of lineup DTOs.



getPlayerURL
public function getPlayerURL ( ): String
Returns the URL at which this instance of the player is loading. The URL is determined by the player by introspecting the page on which it is located.

Parameters
n/a


Returns
The URL at which this player is loading.



getPlayerValue
public function getPlayerValue ( key: String ): String
Returns the value for the key passed in, as set in the Brightcove console.

Parameters
key - The key by which a user-defined value is stored.


Returns
The value for the key requested.



getPublisherId
public function getPublisherId ( ): Number
Returns the id of the publisher (account) to which this player belongs. If you are executing this method on your own player it will return your publisher id.

Parameters
n/a


Returns
The id of the publisher to whom this player belongs.



getTitleById
public function getTitleById ( titleId: Number ): Object
Returns the title DTO for the id passed in if it is currently loaded in the player.

Parameters