Package | se.videoplaza.kit.api |
Class | public class VpAdPlayerWrapper |
Inheritance | VpAdPlayerWrapper ![]() |
Property | Defined by | ||
---|---|---|---|
afterLinearCallback : Function [write-only]
Adds a callback function the Adplayer will trigger after linear ads are shown.
| VpAdPlayerWrapper | ||
beforeLinearCallback : Function [write-only]
Adds a callback function the Adplayer will trigger before linear ads are shown.
| VpAdPlayerWrapper | ||
betweenSponsorAndAdCallback : Function [write-only]
Adds a callback function the Adplayer will trigger in between showing a sponsor ad and a normal ad.
| VpAdPlayerWrapper | ||
deviceContainer : String | VpAdPlayerWrapper | ||
height : Number | VpAdPlayerWrapper | ||
maxBitRate : Number | VpAdPlayerWrapper | ||
persistentID : String | VpAdPlayerWrapper | ||
width : Number | VpAdPlayerWrapper | ||
x : Number | VpAdPlayerWrapper | ||
y : Number | VpAdPlayerWrapper |
Method | Defined by | ||
---|---|---|---|
VpAdPlayerWrapper(adPlayerObject:Object)
Constructor.
| VpAdPlayerWrapper | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
| VpAdPlayerWrapper | ||
addInsertionPoints(requestSettings:RequestSettings, tags:Array = null, customParameters:Dictionary = null):void
Adds an insertion point to the current session.
| VpAdPlayerWrapper | ||
disable():void
Disables all ads, turns visibility off.
| VpAdPlayerWrapper | ||
enable():void
Enables all ads, turns visibility on.
| VpAdPlayerWrapper | ||
getAdModule(name:String):Object
Returns a specific AdModule.
| VpAdPlayerWrapper | ||
getAdModules():Object
| VpAdPlayerWrapper | ||
Retrieves the current itemInfo object.
| VpAdPlayerWrapper | ||
getInsertionPointPreparationTimeout(insertionPointType:String, cuePoint:Object = null):Number
Returns the maximum amount of time in seconds it will take to prepare the insertion point with
prepareInsertionPoint . | VpAdPlayerWrapper | ||
getVolume():Number
Retrieves the current AdPlayer volume.
| VpAdPlayerWrapper | ||
hasEventListener(type:String):Boolean
| VpAdPlayerWrapper | ||
isEnabled():Boolean
Returns
true if the AdPlayer is currently enabled. | VpAdPlayerWrapper | ||
mute(doMute:Boolean):void
Mutes or unmutes the AdPlayer.
| VpAdPlayerWrapper | ||
prepareInsertionPoint(insertionPointType:String, cuePoint:Object = null):void
Prepares an insertion point.
| VpAdPlayerWrapper | ||
registerTarget(config:Object):void
Register a target for displaying ads.
| VpAdPlayerWrapper | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
| VpAdPlayerWrapper | ||
reset():void
Resets the AdPlayer completely.
| VpAdPlayerWrapper | ||
setAdModuleSize(adModuleName:String, dim:Rectangle):void
| VpAdPlayerWrapper | ||
setAutoTriggerCuePoints(b:Boolean):void
Instructs the AdPlayer whether to check for and trigger cue points on it's own,
or leave this responsibility to the bridge / video player.
| VpAdPlayerWrapper | ||
setMetaData(metaData:Object, excludeInsertionPointTypes:Array = null):void
Send metadata to the AdPlayer in order to show overlays, midrolls and postrolls.
| VpAdPlayerWrapper | ||
setNewItem(itemInfo:ItemInfo, excludeInsertionPointTypes:Array = null):void
Informs the AdPlayer that a new item has been activated, initiating the ad session.
| VpAdPlayerWrapper | ||
setPlayerState(state:String):void
Informs the AdPlayer about the current state of the video player.
| VpAdPlayerWrapper | ||
setSize(w:Number, h:Number, viewMode:String):void
Sets the size of the AdPlayer.
| VpAdPlayerWrapper | ||
setVolume(value:Number):void
Sets the AdPlayer volume.
| VpAdPlayerWrapper | ||
start():void
Starts the AdPlayer.
After having received the VpEventType.AD_PLAYER_READY event from the AdPlayer, run this function to start it. | VpAdPlayerWrapper | ||
triggerInsertionPoint(insertionPointType:String, cuePoint:Object = null):void
Triggers an insertion point.
| VpAdPlayerWrapper |
afterLinearCallback | property |
afterLinearCallback:Function
[write-only]
Adds a callback function the Adplayer will trigger after linear ads are shown. To let the Adplayer know when to resume, trigger the provided resume
callback.
public function set afterLinearCallback(value:Function):void
function afterLinear(ads:Array, resume:function):void
beforeLinearCallback | property |
beforeLinearCallback:Function
[write-only]
Adds a callback function the Adplayer will trigger before linear ads are shown. To let the Adplayer know when to start linear ad playback again, trigger the provided startLinear
callback.
public function set beforeLinearCallback(value:Function):void
function beforeLinear(ads:Array, startLinear:function):void
betweenSponsorAndAdCallback | property |
betweenSponsorAndAdCallback:Function
[write-only]
Adds a callback function the Adplayer will trigger in between showing a sponsor ad and a normal ad. To let the Adplayer know when to resume, trigger the provided resume
callback.
public function set betweenSponsorAndAdCallback(value:Function):void
function betweenSponsorAndAdCallback(resume:function):void
deviceContainer | property |
deviceContainer:String
[read-write]Implementation
public function get deviceContainer():String
public function set deviceContainer(value:String):void
height | property |
height:Number
[read-write]Implementation
public function get height():Number
public function set height(value:Number):void
maxBitRate | property |
maxBitRate:Number
[read-write]Implementation
public function get maxBitRate():Number
public function set maxBitRate(value:Number):void
persistentID | property |
persistentID:String
[read-write]Implementation
public function get persistentID():String
public function set persistentID(value:String):void
width | property |
width:Number
[read-write]Implementation
public function get width():Number
public function set width(value:Number):void
x | property |
x:Number
[read-write]Implementation
public function get x():Number
public function set x(value:Number):void
y | property |
y:Number
[read-write]Implementation
public function get y():Number
public function set y(value:Number):void
VpAdPlayerWrapper | () | constructor |
public function VpAdPlayerWrapper(adPlayerObject:Object)
Constructor. Creates a new instance of the VpAdPlayerWrapper.
ParametersadPlayerObject:Object — This required parameter sets up the actual AdPlayer.
The adPlayerObject is retrieved from the bootloader callback after calling the createAdPlayer function.
|
See also
private var videoplaza:Object; private var adPlayer:VpAdPlayerWrapper; private function loadBootloader():void { loader.contentLoaderInfo.addEventListener(Event.INIT, onBootloadInit); //Load the bootloader: loader.load(new URLRequest(URLToBootloader)); } // Loader callback: private function onBootloadInit(ev:Event) { videoplaza = Object(ev.target.content); addChild(DisplayObject(videoplaza)); // Setup bootloader callback by first casting the bootloader to an EventDispatcher object: EventDispatcher(videoplaza).addEventListener(Event.INIT, function(evt:Event):void { // Setup the Pulse ad player setupAdPlayer(); }); } //Bootloader callback: private function setupAdPlayer():void { // Create a config object var adPlayerConf:Object = new Object(); adPlayerConf.x = myVideoPlayer.x; adPlayerConf.y = myVideoPlayer.x; adPlayerConf.width = myVideoPlayer.width; adPlayerConf.height = myVideoPlayer.height; // Compose and add the VpAdPlayerWrapper to the stage by running the "createAdPlayer" method on the bootloader (recasted to an object), // passing the adPlayerConf object to the method: var vpObject:DisplayObject = Object(videoplaza).createAdPlayer( adPlayerConf ); adPlayer = new VpAdPlayerWrapper( vpObject); addChild(vpObject); }
addEventListener | () | method |
public override function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Parameters
type:String |
|
listener:Function |
|
useCapture:Boolean (default = false )
|
|
priority:int (default = 0 )
|
|
useWeakReference:Boolean (default = false )
|
addInsertionPoints | () | method |
public function addInsertionPoints(requestSettings:RequestSettings, tags:Array = null, customParameters:Dictionary = null):void
Adds an insertion point to the current session. Supported insertion points to add are:
InsertionPointType.ON_CUE_POINT
InsertionPointType.ON_CONTENT_END
Note! You cannot ask for InsertionPointType.ON_CUE_POINT
on the exact same RequestSettings.cuePoints
(cue point time) more than once.
requestSettings:RequestSettings |
|
tags:Array (default = null )
|
|
customParameters:Dictionary (default = null )
|
See also
disable | () | method |
public function disable():void
Disables all ads, turns visibility off.
enable | () | method |
public function enable():void
Enables all ads, turns visibility on.
getAdModule | () | method |
public function getAdModule(name:String):Object
Returns a specific AdModule.
Parametersname:String — The name of the AdModule to get. All supported AdModules' names are available in the class VpAdModuleName.
|
Object |
See also
private var adPlayer:VpAdPlayerWrapper; private var spotModule:VpAdModule; // Setup AdPlayer listener private function setupAdPlayerListeners(evt:Event) { adPlayer.addEventListener(VpEventType.AD_MODULE_CREATED, onAdPlayerEvent); } // AdPlayer event handler that gets the spot AdModule and wraps it. private function onAdPlayerEvent( event:Event ):void { switch( event.type ) { case VpEventType.AD_MODULE_CREATED: var moduleName:String = Object( event ).getData() as String; if( moduleName == VpAdModuleName.SPOT_ADMODULE ) { spotModule = new VpAdModule( adPlayer.getAdModule( VpAdModuleName.SPOT_ADMODULE ) ); } break; } }
getAdModules | () | method |
public function getAdModules():Object
Returns
Object |
getCurrentItem | () | method |
public function getCurrentItem():ItemInfo
Retrieves the current itemInfo object.
ReturnsItemInfo —
ItemInfo object
|
See also
getInsertionPointPreparationTimeout | () | method |
public function getInsertionPointPreparationTimeout(insertionPointType:String, cuePoint:Object = null):Number
Returns the maximum amount of time in seconds it will take to prepare the insertion point with prepareInsertionPoint
.
insertionPointType:String — The insertion point type. Possible values: InsertionPointType.ON_CUE_POINT and InsertionPointType.ON_CONTENT_END
|
|
cuePoint:Object (default = null ) — Needed for insertionPointType:InsertionPointType.ON_CUE_POINT
|
Number — The maximum amount of time in seconds it will take to prepare the insertion point
|
See also
getVolume | () | method |
public function getVolume():Number
Retrieves the current AdPlayer volume.
ReturnsNumber — Number ranging from 0 to 1.
|
hasEventListener | () | method |
public override function hasEventListener(type:String):Boolean
Parameters
type:String |
Boolean |
isEnabled | () | method |
public function isEnabled():Boolean
Returns true
if the AdPlayer is currently enabled.
Boolean |
mute | () | method |
public function mute(doMute:Boolean):void
Mutes or unmutes the AdPlayer.
ParametersdoMute:Boolean — Boolean.
|
prepareInsertionPoint | () | method |
public function prepareInsertionPoint(insertionPointType:String, cuePoint:Object = null):void
Prepares an insertion point. It is only needed to prepare insertion points that are lazy loaded and manually triggered.
You should prepare InsertionPointType.ON_CONTENT_END
(postrolls).
You should also prepare InsertionPointType.ON_CUE_POINT
(midrolls) if setAutoTriggerCuePoints
is set to false
.
Check when you need to prepare the insertion point by calling getInsertionPointPreparationTimeout
insertionPointType:String — The insertion point type to prepare, possible values:InsertionPointType.ON_CONTENT_END and InsertionPointType.ON_CUE_POINT
|
|
cuePoint:Object (default = null ) — Needed for insertionPointType:InsertionPointType.ON_CUE_POINT
|
See also
registerTarget | () | method |
public function registerTarget(config:Object):void
Register a target for displaying ads.
Parametersconfig:Object — An object with these parameters:
|
removeEventListener | () | method |
public override function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Parameters
type:String |
|
listener:Function |
|
useCapture:Boolean (default = false )
|
reset | () | method |
public function reset():void
Resets the AdPlayer completely.
setAdModuleSize | () | method |
public function setAdModuleSize(adModuleName:String, dim:Rectangle):void
Parameters
adModuleName:String |
|
dim:Rectangle |
setAutoTriggerCuePoints | () | method |
public function setAutoTriggerCuePoints(b:Boolean):void
Instructs the AdPlayer whether to check for and trigger cue points on it's own, or leave this responsibility to the bridge / video player.
Parametersb:Boolean — If set to true, the AdPlayer will handle all triggering of cue points,
provided it will be updated correctly via the time reference object.If set to false, the bridge / video player will update the AdPlayer (trigger ads) when cue points occur. |
See also
setMetaData | () | method |
public function setMetaData(metaData:Object, excludeInsertionPointTypes:Array = null):void
Send metadata to the AdPlayer in order to show overlays, midrolls and postrolls.
Use this function if meta information about the current video hasn't already been defined in setNewItem(iteminfo:ItemInfoObject)
.
metaData:Object — object from the video.
|
|
excludeInsertionPointTypes:Array (default = null ) — Excludes the passed insertion point types in the following ad request.
When using this you have to make sure, those insertionPoints are added later.
Note!
|
See also
setNewItem | () | method |
public function setNewItem(itemInfo:ItemInfo, excludeInsertionPointTypes:Array = null):void
Informs the AdPlayer that a new item has been activated, initiating the ad session.
ParametersitemInfo:ItemInfo — Required itemInfo object describing the current item.
|
|
excludeInsertionPointTypes:Array (default = null ) — Excludes the passed insertion point types in the following initial ad request.
When using this you have to make sure those insertionPoints are added later.
Note! Excluding insertion point types is highly discouraged. Make sure you know why you are doing so before introducing this behavior, as this affects ad delivery and Pulse account setup. |
See also
setPlayerState | () | method |
public function setPlayerState(state:String):void
Informs the AdPlayer about the current state of the video player.
Parametersstate:String — The current video player state.
|
See also
setSize | () | method |
public function setSize(w:Number, h:Number, viewMode:String):void
Sets the size of the AdPlayer.
Parametersw:Number — width in pixels
|
|
h:Number — height in pixels
|
|
viewMode:String — Can be one of ViewMode.NORMAL or ViewMode.FULLSCREEN to indicate the mode to which the AdPlayer should resize to.
|
setVolume | () | method |
public function setVolume(value:Number):void
Sets the AdPlayer volume.
Parametersvalue:Number — Number ranging from 0 to 1.
|
start | () | method |
public function start():void
Starts the AdPlayer.
After having received the VpEventType.AD_PLAYER_READY
event from the AdPlayer, run this function to start it.
See also
triggerInsertionPoint | () | method |
public function triggerInsertionPoint(insertionPointType:String, cuePoint:Object = null):void
Triggers an insertion point.
ParametersinsertionPointType:String — The insertion point type to trigger.
Triggerable insertion points:
|
|
cuePoint:Object (default = null ) — Needed for InsertionPointType.ON_CUE_POINT
|
See also