Class: AdDisplayContainer



new AdDisplayContainer(containerElement, videoElement, clickTrackingElement)



The element to display the ads in. The element must be inserted into the DOM before creating AdDisplayContainer.

Value must not be null.



Specifies the alternative video ad playback element. We recommend always passing in your content video player.

Value must not be null.



Specifies the alternative video ad click element. Leave this null to let the SDK handle clicks. Even if supplied, the SDK will only use the custom click tracking element when non-AdSense/AdX creatives are displayed in environments that do not support UI elements overlaying a video player (e.g., iPhone or pre-4.0 Android). The custom click tracking element should never be rendered over the video player because it can intercept clicks to UI elements that the SDK renders. Also note that the SDK will not modify the visibility of the custom click tracking element. This means that if a custom click tracking element is supplied, it must be properly displayed when the linear ad is played. You can check ima.AdsManager.isCustomClickTrackingUsed when the ima.AdEvent.Type.STARTED event is fired to determine whether or not to display your custom click tracking element. If appropriate for your UI, you should hide the click tracking element when the ima.AdEvent.Type.CONTENT_RESUME_REQUESTED event fires.

Value must not be null.




Destroys internal state and previously created DOM elements. The IMA SDK will be unloaded and no further calls to any APIs should be made.



Initializes the video playback. On mobile platforms, including iOS and Android browsers, first interaction with video playback is only allowed within a user action (a click or tap) to prevent unexpected bandwidth costs. Call this method as a direct result of a user action before starting the ad playback. This method has no effect on desktop platforms and when custom video playback is used.