Ad

public interface Ad


An object that holds data corresponding to the main Ad.

Summary

Public methods

abstract @Nullable String

Returns the ad ID as specified in the VAST response.

abstract AdPodInfo

Returns the pod metadata object.

abstract @Nullable String

Returns the ad system as specified in the VAST response.

abstract @Nullable String[]

Returns the IDs of the ads' creatives, starting with the first wrapper ad.

abstract @Nullable String[]

Returns the wrapper ad IDs as specified in the VAST response.

abstract @Nullable String[]

Returns the wrapper ad systems as specified in the VAST response.

abstract @Nullable String

Returns the advertiser name as defined by the serving party.

abstract List<CompanionAd>

Returns the companions for the current ad while using DAI.

abstract @Nullable String

Returns the content type of the currently selected creative, or null if no creative is selected or the content type is unavailable.

abstract @Nullable String

Returns the Industry Standard Commercial Identifier (ISCI) code for an ad.

abstract @Nullable String

Returns the ID of the selected creative for the ad,

abstract @Nullable String

Returns the first deal ID present in the wrapper chain for the current ad, starting from the top of the chain.

abstract @Nullable String

Returns the description of this ad from the VAST response.

abstract double

Returns the duration of the ad in seconds, -1 if not available.

abstract int

Returns the height of the selected creative if non-linear, else returns 0.

abstract double

Returns the number of seconds of playback before the ad becomes skippable.

abstract @Nullable String

Returns the URL associated with the survey for the given ad.

abstract @Nullable String

Returns the title of this ad from the VAST response.

abstract @Nullable String

Returns custom parameters associated with the ad at the time of ad trafficking.

abstract Set<UiElement>

Returns the set of ad UI elements the IMA SDK renders for this ad.

abstract @Nullable UniversalAdId[]

The list of all universal ad IDs for this ad.

abstract int

Returns the VAST bitrate in Kbps of the selected creative.

abstract int

Returns the VAST media height in pixels of the selected creative.

abstract int

Returns the VAST media width in pixels of the selected creative.

abstract int

Returns the width of the selected creative if non-linear, else returns 0.

abstract boolean

Indicates whether the ad’s current mode of operation is linear or non-linear.

abstract boolean

Indicates whether the ad can be skipped by the user.

Public methods

getAdId

abstract @Nullable String getAdId()

Returns the ad ID as specified in the VAST response.

getAdPodInfo

abstract AdPodInfo getAdPodInfo()

Returns the pod metadata object.

getAdSystem

abstract @Nullable String getAdSystem()

Returns the ad system as specified in the VAST response.

getAdWrapperCreativeIds

abstract @Nullable String[] getAdWrapperCreativeIds()

Returns the IDs of the ads' creatives, starting with the first wrapper ad.

getAdWrapperIds

abstract @Nullable String[] getAdWrapperIds()

Returns the wrapper ad IDs as specified in the VAST response.

getAdWrapperSystems

abstract @Nullable String[] getAdWrapperSystems()

Returns the wrapper ad systems as specified in the VAST response.

getAdvertiserName

abstract @Nullable String getAdvertiserName()

Returns the advertiser name as defined by the serving party.

getCompanionAds

abstract List<CompanionAdgetCompanionAds()

Returns the companions for the current ad while using DAI. Returns an empty list in any other scenario.

getContentType

abstract @Nullable String getContentType()

Returns the content type of the currently selected creative, or null if no creative is selected or the content type is unavailable. For linear ads, the content type is only going to be available after the START event, when the media file is selected.

Returns
@Nullable String

The content type, null if not available.

getCreativeAdId

abstract @Nullable String getCreativeAdId()

Returns the Industry Standard Commercial Identifier (ISCI) code for an ad. This is the Ad-ID of the selected creative in the VAST response.

getCreativeId

abstract @Nullable String getCreativeId()

Returns the ID of the selected creative for the ad,

getDealId

abstract @Nullable String getDealId()

Returns the first deal ID present in the wrapper chain for the current ad, starting from the top of the chain.

getDescription

abstract @Nullable String getDescription()

Returns the description of this ad from the VAST response.

Returns
@Nullable String

The description, null if not specified.

getDuration

abstract double getDuration()

Returns the duration of the ad in seconds, -1 if not available.

getHeight

abstract int getHeight()

Returns the height of the selected creative if non-linear, else returns 0.

getSkipTimeOffset

abstract double getSkipTimeOffset()

Returns the number of seconds of playback before the ad becomes skippable. -1 is returned for non-skippable ads, or if the value is unavailable.

getSurveyUrl

abstract @Nullable String getSurveyUrl()

Returns the URL associated with the survey for the given ad.

getTitle

abstract @Nullable String getTitle()

Returns the title of this ad from the VAST response.

Returns
@Nullable String

The title, null if not specified.

getTraffickingParameters

abstract @Nullable String getTraffickingParameters()

Returns custom parameters associated with the ad at the time of ad trafficking.

getUiElements

abstract Set<UiElementgetUiElements()

Returns the set of ad UI elements the IMA SDK renders for this ad. This set may be different from the set of UI elements provided at setUiElements, because in some cases, some elements may be required to be displayed or unable to be displayed.

getUniversalAdIds

abstract @Nullable UniversalAdId[] getUniversalAdIds()

The list of all universal ad IDs for this ad.

getVastMediaBitrate

abstract int getVastMediaBitrate()

Returns the VAST bitrate in Kbps of the selected creative.

getVastMediaHeight

abstract int getVastMediaHeight()

Returns the VAST media height in pixels of the selected creative.

getVastMediaWidth

abstract int getVastMediaWidth()

Returns the VAST media width in pixels of the selected creative.

getWidth

abstract int getWidth()

Returns the width of the selected creative if non-linear, else returns 0.

isLinear

abstract boolean isLinear()

Indicates whether the ad’s current mode of operation is linear or non-linear. Currently non-linear ads are not implemented and this will always return true.

isSkippable

abstract boolean isSkippable()

Indicates whether the ad can be skipped by the user.