ImaAdTagUriBuilder


@UnstableApi
public final class ImaAdTagUriBuilder


Builder for URI for IMA client side ad insertion streams.

Summary

Nested types

Types of video orientations.

Constants

static final int
static final int
static final int
static final int

Public constructors

Creates a new instance.

Public methods

Uri

Builds a URI with the builder's current values.

ImaAdTagUriBuilder

Sets the preferred linear orientation to be used.

Constants

IMA_ORIENTATION_LANDSCAPE

public static final int IMA_ORIENTATION_LANDSCAPE = 1

IMA_ORIENTATION_PORTRAIT

public static final int IMA_ORIENTATION_PORTRAIT = 2

IMA_ORIENTATION_SQUARE

public static final int IMA_ORIENTATION_SQUARE = 3

IMA_ORIENTATION_UNSET

public static final int IMA_ORIENTATION_UNSET = 0

Public constructors

ImaAdTagUriBuilder

public ImaAdTagUriBuilder(Uri uri)

Creates a new instance.

Parameters
Uri uri

The URI.

Public methods

build

public Uri build()

Builds a URI with the builder's current values. This URI can be used in the call to AdConfiguration.Builder.setAdTagUri().

Returns
Uri

The build Uri.

Throws
java.lang.IllegalStateException

If the builder has missing or invalid inputs.

setPreferredLinearOrientation

@CanIgnoreReturnValue
public ImaAdTagUriBuilder setPreferredLinearOrientation(
    @ImaAdTagUriBuilder.ImaOrientationType int preferredLinearOrientation
)

Sets the preferred linear orientation to be used. The publisher can specify an orientation that ads should be displayed in.

Parameters
@ImaAdTagUriBuilder.ImaOrientationType int preferredLinearOrientation

The preferred linear orientation.

Returns
ImaAdTagUriBuilder

This instance, for convenience.