AdController

abstract class AdController

This interface is used to control an ad unit rendered by Nimbus.

The AdController is designed to be an abstraction around the different types of ad creative Nimbus supports. The AdController provides methods for starting and stopping ads, retrieving information about the current state of an ad, controlling the volume, and destroying the ad.

Each AdController instance is responsible for firing to its collections of listeners events representing state changes of the ad.

Be sure to call destroy whenever an ad is no longer needed. If using the default renderers provided by Nimbus, the ad will destroy itself when a video completes; static ads can be configured to fire a completion event after a set time but must be manually destroyed.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Listens for events and errors from an AdController.

Properties

Link copied to clipboard
open val duration: Float

Returns the duration of this Ad.

Link copied to clipboard
@get:JvmName(name = "friendlyObstructions")
val friendlyObstructions: MutableCollection<View>

Returns a list of friendly obstructions

Link copied to clipboard

A collection of AdController listener objects.

Link copied to clipboard
open val view: View? = null

Returns the View that this AdController manages.

Link copied to clipboard
open var volume: Int

The current volume of this AdController from 0 to 100.

Functions

Link copied to clipboard
abstract fun destroy()

Destroys this AdController and associated resources.

Link copied to clipboard

This will disable all click protections on a Nimbus ad, use at your own risk

Link copied to clipboard

This is a convenience method for backwards compatibility with Java

Link copied to clipboard
open fun start()

Start the ad playback.

Link copied to clipboard
open fun stop()

Stop the ad playback.