Packagecom.brightcove.fl.advertising
Classpublic class AdContext
InheritanceAdContext Inheritance Object

Holds the current state of the player for use in an ad translator. You can use these properties and functions to handle an ad translation. Unlike AdSwfContext, some of the properties in the API modules are duplicated within AdContext. For instance, playerID is the same as moduleLoader.getModule("videoPlayer").getCurrentVideo().id. It doesn't matter which way you access these properties.



Public Properties
 PropertyDefined By
  additionalAdTargetingParams : String
[read-only] Returns the string passed in the initial snippet to be appended to ad calls.
AdContext
  adFormats : Array
[read-only] Returns an array of supported ad format IDs for the experience.
AdContext
  adID : Number
[read-only] Returns a unique ID which can be used in the URL for ad requests.
AdContext
  adServerURL : String
[read-only] Returns the ad server specified for the experience.
AdContext
  affiliateID : Number
[read-only]
AdContext
  categories : Array
[read-only] Returns the adCategories of the title, if any, that was loaded at the time of the ad request.
AdContext
  cuePoint : Object
[read-only] Returns the cue point, if any, that prompted the ad request.
AdContext
  insertionKeyValues : String
[read-only] Returns the ad key value pairs associated with the point of ad insertion.
AdContext
  isCGM : Boolean
[read-only] Returns whether the title, if any, that was loaded at the time of the ad request is a CGM title.
AdContext
  isVASTWrapperRequest : Boolean
[read-only] Returns whether this ad request comes from VAST Wrapper
AdContext
  lineupID : Number
[read-only] Returns the lineupId of the title, if any, that was loaded at the time of the ad request.
AdContext
  moduleLoader : Object
[read-only] Allows access to the APIs, even if APIs are disabled in the current player.
AdContext
  playerID : Number
[read-only] Returns the id for the player.
AdContext
  playerKeyValues : String
[read-only] Returns the ad key value pairs associated with the player.
AdContext
  playlistTargeting : String
[read-only] Returns the details for playlistTargeting.
AdContext
  publisherID : Number
[read-only] Returns the publisherID for the player.
AdContext
  remnantRequest : Boolean
[read-only] Returns whether the ads requested were for Brightcove remnants.
AdContext
  tags : Array
[read-only] Returns the tags of the title, if any, that was loaded at the time of the ad request.
AdContext
  thirdPartyAdXML : XML
[read-only] XML from a requestThirdPartyAd call
AdContext
  titleID : Number
[read-only] Returns the id of the title, if any, that was loaded at the time of the ad request.
AdContext
  titleKeyValues : String
[read-only] Returns the ad key value pairs associated with the title.
AdContext
  type : String
[read-only] Returns the type of ads that were requested: AdContext.ON_LOAD or AdContext.CUE
AdContext
  video : Object
[read-only] Returns the video, if any, that is loaded at the time of the ad request.
AdContext
Public Methods
 MethodDefined By
  
getAllKeyValues(pDelimiter:String):String
Combines and returns all custom key-value pairs from the player.
AdContext
Public Constants
 ConstantDefined By
  CUE : String = cue
[static] Constant for type
AdContext
  ON_LOAD : String = onload
[static] Constant for type
AdContext
Property Detail
additionalAdTargetingParamsproperty
additionalAdTargetingParams:String  [read-only]

Returns the string passed in the initial snippet to be appended to ad calls.


Implementation
    public function get additionalAdTargetingParams():String
adFormatsproperty 
adFormats:Array  [read-only]

Returns an array of supported ad format IDs for the experience.


Implementation
    public function get adFormats():Array
adIDproperty 
adID:Number  [read-only]

Returns a unique ID which can be used in the URL for ad requests.


Implementation
    public function get adID():Number
adServerURLproperty 
adServerURL:String  [read-only]

Returns the ad server specified for the experience.


Implementation
    public function get adServerURL():String
affiliateIDproperty 
affiliateID:Number  [read-only]


Implementation
    public function get affiliateID():Number
categoriesproperty 
categories:Array  [read-only]

Returns the adCategories of the title, if any, that was loaded at the time of the ad request.


Implementation
    public function get categories():Array
cuePointproperty 
cuePoint:Object  [read-only]

Returns the cue point, if any, that prompted the ad request. The name and metadata of the cuepoint can be accessed as properties on the Object. The name property can be one of "onload", "Pre-roll", "Mid-roll", or "Post-roll"


Implementation
    public function get cuePoint():Object
insertionKeyValuesproperty 
insertionKeyValues:String  [read-only]

Returns the ad key value pairs associated with the point of ad insertion.


Implementation
    public function get insertionKeyValues():String
isCGMproperty 
isCGM:Boolean  [read-only]

Returns whether the title, if any, that was loaded at the time of the ad request is a CGM title.


Implementation
    public function get isCGM():Boolean
isVASTWrapperRequestproperty 
isVASTWrapperRequest:Boolean  [read-only]

Returns whether this ad request comes from VAST Wrapper


Implementation
    public function get isVASTWrapperRequest():Boolean
lineupIDproperty 
lineupID:Number  [read-only]

Returns the lineupId of the title, if any, that was loaded at the time of the ad request.


Implementation
    public function get lineupID():Number
moduleLoaderproperty 
moduleLoader:Object  [read-only]

Allows access to the APIs, even if APIs are disabled in the current player. Valid functions are loadModules() and getModule(). When loadModules() is complete, it dispatches Event.COMPLETE Some of the parameters in AdContext and duplicate values in the API modules. It doesn't matter which way you access these values. For instance, playerID is the same as moduleLoader.getModule("videoPlayer").getCurrentVideo().id


Implementation
    public function get moduleLoader():Object
playerIDproperty 
playerID:Number  [read-only]

Returns the id for the player.


Implementation
    public function get playerID():Number
playerKeyValuesproperty 
playerKeyValues:String  [read-only]

Returns the ad key value pairs associated with the player.


Implementation
    public function get playerKeyValues():String
playlistTargetingproperty 
playlistTargeting:String  [read-only]

Returns the details for playlistTargeting. If the playlistTargeting parameter was used (to specify targeting by playlistName, playlistID, or playlistRefID), this method will return the approporiate information for the current playlist. If no playlistTargeting is being used, then this return an empty String.


Implementation
    public function get playlistTargeting():String
publisherIDproperty 
publisherID:Number  [read-only]

Returns the publisherID for the player.


Implementation
    public function get publisherID():Number
remnantRequestproperty 
remnantRequest:Boolean  [read-only]

Returns whether the ads requested were for Brightcove remnants. This is a deprecated feature and the call always returns false.


Implementation
    public function get remnantRequest():Boolean
tagsproperty 
tags:Array  [read-only]

Returns the tags of the title, if any, that was loaded at the time of the ad request.


Implementation
    public function get tags():Array
thirdPartyAdXMLproperty 
thirdPartyAdXML:XML  [read-only]

XML from a requestThirdPartyAd call


Implementation
    public function get thirdPartyAdXML():XML
titleIDproperty 
titleID:Number  [read-only]

Returns the id of the title, if any, that was loaded at the time of the ad request.


Implementation
    public function get titleID():Number
titleKeyValuesproperty 
titleKeyValues:String  [read-only]

Returns the ad key value pairs associated with the title.


Implementation
    public function get titleKeyValues():String
typeproperty 
type:String  [read-only]

Returns the type of ads that were requested: AdContext.ON_LOAD or AdContext.CUE


Implementation
    public function get type():String
videoproperty 
video:Object  [read-only]

Returns the video, if any, that is loaded at the time of the ad request.


Implementation
    public function get video():Object
Method Detail
getAllKeyValues()method
public function getAllKeyValues(pDelimiter:String):String

Combines and returns all custom key-value pairs from the player. This will include the following levels of key-values pairs, if available: player, video, insertion, cue point, and config additionalAdTargetingParams. If you want to have a delimiter other than ";" for combining the key-value pair strings then specify your string delimiter as the single parameter.

Parameters

pDelimiter:String — A string specifying what delimiter to use when combining the key-value pairs into one string. The default is ";".

Returns
String
Constant Detail
CUEConstant
public static const CUE:String = cue

Constant for type

ON_LOADConstant 
public static const ON_LOAD:String = onload

Constant for type