Implements com.google.ads.studio.vpaid:IVpaid
An adaptor class that implements the IVpaid interface. It delegates most tasks to the VpaidEnabler. The adaptor class makes sure that the publisher SDK can't access non-VPAID methods and events on the VpaidEnabler class.
Properties
Name | Type | Description | Default |
---|---|---|---|
adCompanions | String | Returns a VAST-compatible XML snippet for companion ads. |
|
adDuration | Number | Returns the total number of seconds for which the creative is expected to display. A value of -1 indicates that this feature is not supported, as with a non-linear creative. A value of -2 indicates that the duration is unknown, as would be the case if a user were interacting with the creative. |
|
adExpanded | Boolean | Returns true if the ad is currently expanded. |
|
adHeight | Number | Returns the height of the ad in pixels. |
|
adIcons | Boolean | Returns True if the ad unit includes ad icons. Currently not supported. |
|
adLinear | Boolean | Returns true if the ad is currently linear. |
|
adRemainingTime | Number | Returns the number of seconds remaining in the creative. A return value of -1 indicates that this value is not supported (such as in the case of a non-linear creative). A value of -2 indicates that the remaining time is unknown, as would be the case if a user were interacting with the creative. |
|
adSkippableState | Boolean | Returns true if the ad can currently be skipped. |
|
adVolume | Number | Gets and sets the volume of the creative. The values should always be between 0 and 1, unless volume is not supported in which case get returns -1. |
|
adWidth | Number | Returns the width of the ad in pixels. |
|
Events
Name | Type | Description |
---|---|---|
CLICK_THRU | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID ad triggers a click through. |
DURATION_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the duration of the VPAID asset changes. |
ERROR | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID creative encounters an error. |
EXPANDED_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the expanded state of the VPAID asset changes. |
IMPRESSION | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is loaded and counts as an impression. |
INTERACTION | com.google.ads.studio.events.VpaidEvent | Dispatched when there is an interaction with the VPAID asset. |
LINEAR_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset changes linearity. |
LOADED | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is fully loaded and ready for display. |
LOG | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID creative logs a message. |
PAUSED | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID creative is paused. |
PLAYING | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID creative is playing. |
REMAINING_TIME_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the remaining time of the VPAID asset changes. |
SIZED_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the size of the VPAID asset is changed. |
SKIPPABLE_STATE_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the skippability of the VPAID asset changes. |
SKIPPED | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is skipped. |
SKIPPED | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is skipped. |
STARTED | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is started. |
STOPPED | com.google.ads.studio.events.VpaidEvent | Dispatched when the VPAID asset is stopped. |
USER_ACCEPT_INVITATION | com.google.ads.studio.events.VpaidEvent | Dispatched when a user launches an additional portion of the VPAID ad. |
USER_CLOSE | com.google.ads.studio.events.VpaidEvent | Dispatched when the user closes the VPAID creative. |
USER_MINIMIZE | com.google.ads.studio.events.VpaidEvent | Dispatched when the user minimizes the VPAID creative. |
VIDEO_COMPLETE | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID asset completes. |
VIDEO_FIRST_QUARTILE | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID asset reaches the 1st quartile. |
VIDEO_MIDPOINT | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID asset reaches the midpoint. |
VIDEO_START | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID asset starts. |
VIDEO_THIRD_QUARTILE | com.google.ads.studio.events.VpaidEvent | Dispatched when the video in the VPAID asset reaches the 3rd quartile. |
VOLUME_CHANGE | com.google.ads.studio.events.VpaidEvent | Dispatched when the volume of the VPAID asset changes. |
Constructors
VpaidAdaptor(enablerReference:
VpaidEnabler)
Instance Methods
Defined in com.google.ads.studio.vpaid:VpaidAdaptor
collapseAd()
:
void
Tells the ad to collapse to its smallest state.
expandAd()
:
void
Tells the ad to expand if expansion is supported.
handshakeVersion(playerVpaidVersion:String)
:
String
Initializes the ad to use the correct VPAID version. Returns the supported version of VPAID.
initAd(width:Number, height:Number, viewMode:String, desiredBitrate:Number, creativeData:String=null, environmentVars:String=null)
:
void
Initializes the creative with parameters from the VPAID environment.
pauseAd()
:
void
Tells the ad to pause playback. When the ad is paused, it's possible it will no longer be visible.
resizeAd(width:Number, height:Number, viewMode:String)
:
void
Tells the ad to resize to the given dimensions.
resumeAd()
:
void
Tells the ad to resume playback.
skipAd()
:
void
Tells the ad that it should stop playing because the user chose to skip it.
startAd()
:
void
Tells the ad to start playing.
stopAd()
:
void
Tells the ad to stop playing and unload.