BaseDisplayContainer

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 functions

Unit

This function is deprecated.

- This method is redundant once users are using release.

ViewGroup!

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

(Mutable)Collection<CompanionAdSlot!>!

Gets the companion slots that have been set.

Unit

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

Unit

Sets slots for displaying companions.

Unit

Unregisters all previously registered friendly obstructions.

Public functions

destroy

fun destroy(): Unit

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

fun getAdContainer(): ViewGroup!

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

getCompanionSlots

fun getCompanionSlots(): (Mutable)Collection<CompanionAdSlot!>!

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

registerFriendlyObstruction

fun registerFriendlyObstruction(friendlyObstruction: FriendlyObstruction!): Unit

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.

setCompanionSlots

fun setCompanionSlots(companionSlots: (Mutable)Collection<CompanionAdSlot!>?): Unit

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

unregisterAllFriendlyObstructions

fun unregisterAllFriendlyObstructions(): Unit

Unregisters all previously registered friendly obstructions.