Package com.castlabs.sdk.ima

# Class ImaAdRequest.Builder

java.lang.Object
com.castlabs.sdk.ima.ImaAdRequest.Builder

Enclosing class:
  `ImaAdRequest`

public static final class ImaAdRequest.Builder extends Object
Builder for `ImaAdRequest`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Creates a new Builder for `ImaAdRequest`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ImaAdRequest.Builder`
  `disableDefaultAdUi(boolean disableDefaultAdUi)`
  Sets whether to disable the default ad UI rendered by IMA.
  `ImaAdRequest`
  `get()`
  Builds an instance of `ImaAdRequest`.
  `ImaAdRequest.Builder`
  `scheduleDelayMs(long scheduleDelayMs)`
  Sets the time offset that will be added to the current position when manually scheduling ads.
  `ImaAdRequest.Builder`
  `stallAdTimeoutMs(int stallAdTimeoutMs)`
  Sets the timeout in milliseconds to consider the ad playback stalled.
  `ImaAdRequest.Builder`
  `tagUrl(String tagUrl)`
  Sets the ad tag URL.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()
    Creates a new Builder for `ImaAdRequest`.

- ## Method Details

  - ### tagUrl

    public ImaAdRequest.Builder tagUrl(@Nullable String tagUrl)
    Sets the ad tag URL.
    Parameters:
      `tagUrl` - Ad tag Url
    Returns:
      the Builder

  - ### stallAdTimeoutMs

    public ImaAdRequest.Builder stallAdTimeoutMs(int stallAdTimeoutMs)
    Sets the timeout in milliseconds to consider the ad playback stalled.
    Parameters:
      `stallAdTimeoutMs` - Timeout in ms to consider the ad playback stalled and switch to the main content playback
    Returns:
      the Builder

  - ### scheduleDelayMs

    public ImaAdRequest.Builder scheduleDelayMs(long scheduleDelayMs)
    Sets the time offset that will be added to the current position when manually scheduling ads.
    Parameters:
      `scheduleDelayMs` - Time offset that will be added to the current position when manually scheduling ads. Note that this delay is just to allow for a smooth transition to the ad, not to schedule ads in advance.

      The IMA SDK will drop pending ads if they're not played in the seconds following the ad response itself, so the value will be limited to `ImaAdRequest.SCHEDULE_DELAY_MAXIMUM_MS`.

      Default is `ImaAdRequest.SCHEDULE_DELAY_DEFAULT_MS`.

    Returns:
      the Builder

  - ### disableDefaultAdUi

    public ImaAdRequest.Builder disableDefaultAdUi(boolean disableDefaultAdUi)
    Sets whether to disable the default ad UI rendered by IMA.
    Parameters:
      `disableDefaultAdUi` - Flag to Disable the default AD UI rendered by IMA

      The IMA SDK UI will be disabled and the Application is free to provide it's custom AD UI. This flag will have no effect if the VAST Ad response doesnt have the following 1 tag set.

      Default is `ImaAdRequest.DISABLE_IMA_AD_UI`.

    Returns:
      the Builder

  - ### get

    public ImaAdRequest get()
    Builds an instance of `ImaAdRequest`.
    Returns:
      an instance of `ImaAdRequest`