BaseDisplayContainer

public interface BaseDisplayContainer

Known direct subclasses
AdDisplayContainer

A container in which to display the ads.

StreamDisplayContainer

A display container specific to server-side ad insertion.


A base class for more specialized container interfaces. The SDK-owned ad UI will be displayed within the container. Companion ads will be placed in the companion slots. Subclasses are responsible for displaying any additional media (linear ads, streams, etc.).

Summary

Public methods

abstract void

This method is deprecated.

- This method is redundant once users are using release.

abstract ViewGroup

Returns the previously set container, or null if none has been set.

abstract Collection<CompanionAdSlot>

Gets the companion slots that have been set.

abstract void

Registers a view that overlays or obstructs this container as "friendly" for viewability measurement purposes.

abstract void
registerVideoControlsOverlay(View videoControlsOverlay)

This method is deprecated.

- Use registerFriendlyObstruction instead.

abstract void

This method is deprecated.

Use the constructor which determines the Ad Container at construction time.

abstract void

Sets slots for displaying companions.

abstract void

Unregisters all previously registered friendly obstructions.

abstract void

This method is deprecated.

- Use unregisterAllFriendlyObstructions instead.

Public methods

destroy

abstract void destroy()

Releases resources attached to the container. This will invalidate the container and remove all views attached to it. Should be called when the associated AdsLoader is no longer needed.

getAdContainer

abstract ViewGroup getAdContainer()

Returns the previously set container, or null if none has been set.

getCompanionSlots

abstract Collection<CompanionAdSlotgetCompanionSlots()

Gets the companion slots that have been set. Returns an empty list if none have been set.

registerFriendlyObstruction

abstract void registerFriendlyObstruction(FriendlyObstruction friendlyObstruction)

Registers a view that overlays or obstructs this container as "friendly" for viewability measurement purposes.

See Open Measurement in the IMA SDK for guidance on what is and what is not allowed to be registered.

Parameters
FriendlyObstruction friendlyObstruction

An obstruction to be marked as "friendly" until unregistered.

registerVideoControlsOverlay

abstract void registerVideoControlsOverlay(View videoControlsOverlay)

Registers video playback controls that will overlay this container. WARNING: It is critical that video controls obscure as little ad space as possible so that viewability measurement isn't impacted.

Parameters
View videoControlsOverlay

Small or mostly transparent video controls overlay.

setAdContainer

abstract void setAdContainer(ViewGroup container)

Sets the ViewGroup in which linear UI will be displayed.

setCompanionSlots

abstract void setCompanionSlots(@Nullable Collection<CompanionAdSlot> companionSlots)

Sets slots for displaying companions. Passing null will reset the container to having no companion slots.

unregisterAllFriendlyObstructions

abstract void unregisterAllFriendlyObstructions()

Unregisters all previously registered friendly obstructions.

unregisterAllVideoControlsOverlays

abstract void unregisterAllVideoControlsOverlays()

Unregisters all previously registered video controls overlays.