An ad class that's extended by classes representing different ad types.
      | Methods | |
|---|---|
| get | Ad ID is used to synchronize main ad and companion ads. | 
| get | Returns the ad's pod information. | 
| get | The source ad server information included in the ad response. | 
| get | The advertiser name as defined by the serving party. | 
| get | Identifies the API needed to execute the ad. | 
| get | Gets the companion ads for this ad based on companion ad slot size. | 
| get | 
                Returns the content type of the currently selected creative, or empty string if no
                creative is selected or the content type is unavailable.
               | 
| get | 
                Returns the ISCI (Industry Standard Commercial Identifier) code for an ad, or empty
                string if the code is unavailable.
               | 
| get | Retrieves the ID of the selected creative for the ad. | 
| get | 
                Returns the first deal ID present in the wrapper chain for the current ad, starting
                from the top.
               | 
| get | Returns the description of this ad from the VAST response. | 
| get | 
                Returns the duration of the selected creative, or -1 for non-linear creatives.
               | 
| get | Returns the height of the selected non-linear creative. | 
| get | 
                Returns the URL of the media file chosen from the ad based on the media selection
                settings currently in use.
               | 
| get | 
                Returns the minimum suggested duration in seconds that the nonlinear creative should
                be displayed.
               | 
| get | The number of seconds of playback before the ad becomes skippable. | 
| get | Returns the URL associated with the survey for the given ad. | 
| get | Returns the title of this ad from the VAST response. | 
| get | 
                Gets custom parameters associated with the ad at the time of ad trafficking.
               | 
| get | 
                Gets custom parameters associated with the ad at the time of ad trafficking.
               | 
| get | Returns the UI elements that are being displayed when this ad is played. | 
| get | 
                Deprecated. The registry associated with cataloging the UniversalAdId of the
                selected creative for the ad.
               | 
| get | The list of UniversalAdIds of the selected creative for the ad. | 
| get | Deprecated. The UniversalAdId of the selected creative for the ad. | 
| get | 
                When both the creative and the media file have been selected by the SDK, this will
                return the bitrate for the media file as listed in the vast response.
               | 
| get | Returns the VAST media height of the selected creative. | 
| get | Returns the VAST media width of the selected creative. | 
| get | Returns the width of the selected creative. | 
| get | Ad IDs used for wrapper ads. | 
| get | Ad systems used for wrapper ads. | 
| get | Selected creative IDs used for wrapper ads. | 
| is | 
                Indicates whether the ad’s current mode of operation is linear or non-linear.
               | 
Methods
getAdId
getAdId(): string
            
              Ad ID is used to synchronize main ad and companion ads.
              
                
            
          | Returns | |
|---|---|
| string | The ID of the ad, or the empty string if this information is unavailable. | 
getAdPodInfo
getAdSystem
getAdSystem(): string
            
              The source ad server information included in the ad response.
              
                
            
          | Returns | |
|---|---|
| string | The source ad server of the ad, or the empty string if this information is unavailable. | 
getAdvertiserName
getAdvertiserName(): string
            
              The advertiser name as defined by the serving party.
              
                
            
          | Returns | |
|---|---|
| string | The advertiser name, or the empty string if this information is unavailable. | 
getApiFramework
getApiFramework(): string
            
              Identifies the API needed to execute the ad. This corresponds with the apiFramework
              specified in vast.
              
                
            
          | Returns | |
|---|---|
| string | The API framework need to execute the ad, or null if this information is unavailable. | 
getCompanionAds
getCompanionAds(adSlotWidth: number, adSlotHeight: number,
              settings?: CompanionAdSelectionSettings): CompanionAd[]
            
              Gets the companion ads for this ad based on companion ad slot size. Optionally,
              advanced selection settings are accepted. Note that this method will only return
              non-empty array for ad instances acquired on or after STARTED event. Specifically, ads
              from the LOADED event will return an empty array.
              
                
              
                
            
          | Parameters | |
|---|---|
| adSlotWidth: number | Width of the companion ad slot. | 
| adSlotHeight: number | Height of the companion ad slot. | 
|  | The selection settings for companion ads. | 
| Returns | |
|---|---|
| CompanionAd[] | Array of companion ads that matches the settings and the slot size. | 
getContentType
getContentType(): string
            
              Returns the content type of the currently selected creative, or empty string 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 STARTED event, when the media file is
              selected.
              
                
            
          | Returns | |
|---|---|
| string | The content type, empty string if not available. | 
getCreativeAdId
getCreativeAdId(): string
            
              Returns the ISCI (Industry Standard Commercial Identifier) code for an ad, or empty
              string if the code is unavailable. This is the Ad-ID of the creative in the VAST
              response.
              
                
            
          | Returns | |
|---|---|
| string | The ad ID of the creative. | 
getCreativeId
getCreativeId(): string
            
              Retrieves the ID of the selected creative for the ad.
              
                
            
          | Returns | |
|---|---|
| string | The ID of the selected creative for the ad, or the empty string if this information is unavailable. | 
getDealId
getDealId(): string
            
              Returns the first deal ID present in the wrapper chain for the current ad, starting
              from the top. Returns the empty string if unavailable.
              
                
            
          | Returns | |
|---|---|
| string | The deal ID. | 
getDescription
getDescription(): string
            
              Returns the description of this ad from the VAST response.
              
                
            
          | Returns | |
|---|---|
| string | The description, empty if not specified. | 
getDuration
getDuration(): number
            
              Returns the duration of the selected creative, or -1 for non-linear creatives.
              
                
            
          | Returns | |
|---|---|
| number | The selected creative duration in seconds, -1 if non-linear. | 
getHeight
getHeight(): number
            
              Returns the height of the selected non-linear creative.
              
                
            
          | Returns | |
|---|---|
| number | The height of the selected non-linear creative or 0 for a linear creative. | 
getMediaUrl
getMediaUrl(): string
            
              Returns the URL of the media file chosen from the ad based on the media selection
              settings currently in use. Returns null if this information is unavailable. Available
              on STARTED event.
              
                
            
          | Returns | |
|---|---|
| string | The media URL. | 
getMinSuggestedDuration
getMinSuggestedDuration(): number
            
              Returns the minimum suggested duration in seconds that the nonlinear creative should
              be displayed. Returns -2 if the minimum suggested duration is unknown. For linear
              creative it returns the entire duration of the ad.
              
                
            
          | Returns | |
|---|---|
| number | The minimum suggested duration in seconds that a creative should be displayed. | 
getSkipTimeOffset
getSkipTimeOffset(): number
            
              The number of seconds of playback before the ad becomes skippable. -1 is returned for
              non skippable ads or if this is unavailable.
              
                
            
          | Returns | |
|---|---|
| number | The offset in seconds, or -1. | 
getSurveyUrl
getSurveyUrl(): string
            
              Returns the URL associated with the survey for the given ad. Returns null if
              unavailable.
              
                
            
          | Returns | |
|---|---|
| string | The survey URL. | 
getTitle
getTitle(): string
            
              Returns the title of this ad from the VAST response.
              
                
            
          | Returns | |
|---|---|
| string | The title, empty if not specified. | 
getTraffickingParameters
getTraffickingParameters(): { 
  [key: string]: string; 
}
            
              Gets custom parameters associated with the ad at the time of ad trafficking.
              
                
            
          | Returns | |
|---|---|
| {  | A mapping of trafficking keys to their values, or the empty Object if this information is not available. | 
getTraffickingParametersString
getTraffickingParametersString(): string
            
              Gets custom parameters associated with the ad at the time of ad trafficking. Returns a
              raw string version of the parsed parameters from getTraffickingParameters.
              
                
            
          | Returns | |
|---|---|
| string | Trafficking parameters, or the empty string if this information is not available. | 
getUiElements
getUiElements(): string[]
            
              Returns the UI elements that are being displayed when this ad is played. Refer to
              
                
            
          google.ima.UiElements for possible elements of the array returned.
              | Returns | |
|---|---|
| string[] | The UI elements being displayed. | 
getUniversalAdIdRegistry
getUniversalAdIdRegistry(): string
            
              The registry associated with cataloging the UniversalAdId of the selected creative for
              the ad.
              
              
                
            
          | Returns | |
|---|---|
| string | Returns the registry value, or "unknown" if unavailable. | 
getUniversalAdIds
getUniversalAdIds(): UniversalAdIdInfo[]
            
              The list of UniversalAdIds of the selected creative for the ad.
              
                
            
          | Returns | |
|---|---|
| UniversalAdIdInfo[] | Returns the list of universal ad ID information that applies for this ad. | 
getUniversalAdIdValue
getUniversalAdIdValue(): string
            
              The UniversalAdId of the selected creative for the ad.
              
              
                
            
          | Returns | |
|---|---|
| string | Returns the id value or "unknown" if unavailable. | 
getVastMediaBitrate
getVastMediaBitrate(): number
            
              When both the creative and the media file have been selected by the SDK, this will
              return the bitrate for the media file as listed in the vast response.
              
                
            
          | Returns | |
|---|---|
| number | The bitrate for the selected media file or 0. | 
getVastMediaHeight
getVastMediaHeight(): number
            
              Returns the VAST media height of the selected creative.
              
                
            
          | Returns | |
|---|---|
| number | The VAST media height of the selected creative or 0 if none is selected. | 
getVastMediaWidth
getVastMediaWidth(): number
            
              Returns the VAST media width of the selected creative.
              
                
            
          | Returns | |
|---|---|
| number | The VAST media width of the selected creative or 0 if none is selected. | 
getWidth
getWidth(): number
            
              Returns the width of the selected creative.
              
                
            
          | Returns | |
|---|---|
| number | The width of the selected non-linear creative or 0 for a linear creative. | 
getWrapperAdIds
getWrapperAdIds(): string[]
            
              Ad IDs used for wrapper ads. The IDs returned starts at the inline ad (innermost) and
              traverses to the outermost wrapper ad. An empty array is returned if there are no
              wrapper ads.
              
                
            
          | Returns | |
|---|---|
| string[] | The IDs of the ads, starting at the inline ad, or an empty array if there are no wrapper ads. | 
getWrapperAdSystems
getWrapperAdSystems(): string[]
            
              Ad systems used for wrapper ads. The ad systems returned starts at the inline ad and
              traverses to the outermost wrapper ad. An empty array is returned if there are no
              wrapper ads.
              
                
            
          | Returns | |
|---|---|
| string[] | The ad systems of the ads, starting at the inline ad, or an empty array if there are no wrapper ads. | 
getWrapperCreativeIds
getWrapperCreativeIds(): string[]
            
              Selected creative IDs used for wrapper ads. The creative IDs returned starts at the
              inline ad and traverses to the outermost wrapper ad. An empty array is returned if
              there are no wrapper ads.
              
                
            
          | Returns | |
|---|---|
| string[] | The IDs of the ads' creatives, starting at the inline ad, or an empty array if there are no wrapper ads. | 
isLinear
isLinear(): boolean
            
              Indicates whether the ad’s current mode of operation is linear or non-linear. If the
              value is true, it indicates that the ad is in linear playback mode; if false, it
              indicates non-linear mode. The player checks the linear property and updates its state
              according to the details of the ad placement. While the ad is in linear mode, the
              player pauses the content video. If linear is true initially, and the ad is a pre-roll
              (defined externally), the player may choose to delay loading the content video until
              near the end of the ad playback.
              
                
            
          | Returns | |
|---|---|
| boolean | True if the ad is linear, false otherwise. |