Stay organized with collections
Save and categorize content based on your preferences.
An ad may be part of a pod of ads. This object exposes metadata related to that pod, such as
the number of ads in the pod and ad position within the pod.
The getTotalAds API contained within this object is often correct, but in
certain scenarios, it represents the SDK's best guess. See that method's documentation for
more information.
The total number of ads contained within this pod, including bumpers.
Methods
getAdPosition
getAdPosition(): number
Returns the position of the ad.
Returns
number
The position of the ad within the pod. The value returned is one-based, for
example, 1 of 2, 2 of 2, and more.
getIsBumper
getIsBumper(): boolean
Returns true if the ad is a bumper ad. Bumper ads are short linear ads that can
indicate to a user when the user is entering into or exiting from an ad break.
Returns
boolean
Whether the ad is a bumper ad.
getMaxDuration
getMaxDuration(): number
The maximum duration of the pod in seconds. For unknown duration, -1 is returned.
Returns
number
The maximum duration of the ads in this pod in seconds.
getPodIndex
getPodIndex(): number
Client side and DAI VOD: Returns the index of the ad pod. For a preroll pod, returns
0. For midrolls, returns 1, 2,..., N. For a postroll pod, returns -1. Defaults to 0 if
this ad is not part of a pod, or this pod is not part of a playlist.
DAI live stream: Returns the index of the ad pod. For a preroll pod, returns 0. For
midrolls, returns the break ID. Returns -2 if pod index cannot be determined
(internal error).
Returns
number
The index of the pod in the ad playlist.
getTimeOffset
getTimeOffset(): number
Returns the content time offset at which the current ad pod was scheduled. For pods in
VOD streams with dynamically inserted ads, stream time is returned.
For preroll pod, 0 is returned. For midrolls, the scheduled time is returned. For
postroll, -1 is returned.
Defaults to 0 if this ad is not part of a pod, or the pod is not part of an ad
playlist.
Returns
number
The time offset for the current ad pod.
getTotalAds
getTotalAds(): number
The total number of ads contained within this pod, including bumpers. Bumper ads are
short linear ads that can indicate to a user when the user is entering into or exiting
from an ad break.
Defaults to 1 if this ad is not part of a pod.
In certain scenarios, the SDK does not know for sure how many ads are contained
within this ad pod. These scenarios include ad pods, which are multiple ads within a
single ad tag. In these scenarios, the first few AdEvents fired (AD_METADATA,
LOADED, and more.) may have just the total number of ad tags from the playlist
response. We recommend using the FIRST_QUARTILE event as the event in which
publishers pull information from this object and update the visual elements of the
player, if any.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-17 UTC."],[[["\u003cp\u003eThis documentation outlines the \u003ccode\u003eAdPodInfo\u003c/code\u003e object, which provides metadata about an ad pod, including the number of ads and their position.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetAdPosition\u003c/code\u003e method returns the ad's position within the pod, with values starting at 1.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetIsBumper\u003c/code\u003e method determines whether the ad is a bumper ad, which signals the beginning or end of an ad break.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetTotalAds\u003c/code\u003e returns the total count of ads in the pod, including bumpers, and while often correct, it might be an estimation in some scenarios.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetPodIndex\u003c/code\u003e provides the ad pod's index, with different values depending on whether it's a preroll, midroll, or postroll, and varies slightly between client side and live streams.\u003c/p\u003e\n"]]],[],null,["# Interface AdPodInfo\n\n| **Note:** This reference page follows TypeScript documentation structure. If you have suggestions for or see issues with the reference documentation, open a thread with your feedback on the [IMA technical forum](https://groups.google.com/g/ima-sdk/).\n\n*** ** * ** ***\n\nAn ad may be part of a pod of ads. This object exposes metadata related to that pod, such as the number of ads in the pod and ad position within the pod. \n\n\nThe `getTotalAds` API contained within this object is often correct, but in\ncertain scenarios, it represents the SDK's best guess. See that method's documentation for\nmore information.\n\n| Methods ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|\n| [getAdPosition](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getAdPosition) | Returns the position of the ad. |\n| [getIsBumper](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getIsBumper) | Returns true if the ad is a bumper ad. |\n| [getMaxDuration](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getMaxDuration) | The maximum duration of the pod in seconds. |\n| [getPodIndex](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getPodIndex) | Client side and DAI VOD: Returns the index of the ad pod. |\n| [getTimeOffset](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getTimeOffset) | Returns the content time offset at which the current ad pod was scheduled. |\n| [getTotalAds](/interactive-media-ads/docs/sdks/html5/client-side/reference/interface/google.ima.AdPodInfo#google.ima.AdPodInfo.getTotalAds) | The total number of ads contained within this pod, including bumpers. |\n\nMethods\n-------\n\n*** ** * ** ***\n\n### getAdPosition\n\ngetAdPosition(): number \nReturns the position of the ad.\n\n| Returns ||\n|--------|----------------------------------------------------------------------------------------------------------------|\n| number | The position of the ad within the pod. The value returned is one-based, for example, 1 of 2, 2 of 2, and more. |\n\n*** ** * ** ***\n\n### getIsBumper\n\ngetIsBumper(): boolean \nReturns true if the ad is a bumper ad. Bumper ads are short linear ads that can indicate to a user when the user is entering into or exiting from an ad break.\n\n| Returns ||\n|---------|--------------------------------|\n| boolean | Whether the ad is a bumper ad. |\n\n*** ** * ** ***\n\n### getMaxDuration\n\ngetMaxDuration(): number \nThe maximum duration of the pod in seconds. For unknown duration, -1 is returned.\n\n| Returns ||\n|--------|---------------------------------------------------------|\n| number | The maximum duration of the ads in this pod in seconds. |\n\n*** ** * ** ***\n\n### getPodIndex\n\ngetPodIndex(): number \nClient side and DAI VOD: Returns the index of the ad pod. For a preroll pod, returns 0. For midrolls, returns 1, 2,..., N. For a postroll pod, returns -1. Defaults to 0 if this ad is not part of a pod, or this pod is not part of a playlist. \n\n\nDAI live stream: Returns the index of the ad pod. For a preroll pod, returns 0. For\nmidrolls, returns the break ID. Returns -2 if pod index cannot be determined\n(internal error).\n\n| Returns ||\n|--------|------------------------------------------|\n| number | The index of the pod in the ad playlist. |\n\n*** ** * ** ***\n\n### getTimeOffset\n\ngetTimeOffset(): number \nReturns the content time offset at which the current ad pod was scheduled. For pods in VOD streams with dynamically inserted ads, stream time is returned.\n\n\nFor preroll pod, 0 is returned. For midrolls, the scheduled time is returned. For\npostroll, -1 is returned.\n\n\nDefaults to 0 if this ad is not part of a pod, or the pod is not part of an ad\nplaylist.\n\n| Returns ||\n|--------|-----------------------------------------|\n| number | The time offset for the current ad pod. |\n\n*** ** * ** ***\n\n### getTotalAds\n\ngetTotalAds(): number \nThe total number of ads contained within this pod, including bumpers. Bumper ads are short linear ads that can indicate to a user when the user is entering into or exiting from an ad break. \n\nDefaults to 1 if this ad is not part of a pod.\n\n\nIn certain scenarios, the SDK does not know for sure how many ads are contained\nwithin this ad pod. These scenarios include ad pods, which are multiple ads within a\nsingle ad tag. In these scenarios, the first few AdEvents fired (AD_METADATA,\nLOADED, and more.) may have just the total number of ad tags from the playlist\nresponse. We recommend using the FIRST_QUARTILE event as the event in which\npublishers pull information from this object and update the visual elements of the\nplayer, if any.\n\n| Returns ||\n|--------|---------------------------------|\n| number | Total number of ads in the pod. |"]]