# ImaAdTagUriBuilder

Artifact: [androidx.media3:media3-exoplayer-ima](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/ima/ImaAdTagUriBuilder.java+class:androidx.media3.exoplayer.ima.ImaAdTagUriBuilder)

*** ** * ** ***


```
@UnstableApi
class ImaAdTagUriBuilder
```

<br />

*** ** * ** ***

Builder for URI for IMA client side ad insertion streams.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) annotation https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder.ImaOrientationType` Types of video orientations. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#IMA_ORIENTATION_LANDSCAPE() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#IMA_ORIENTATION_PORTRAIT() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#IMA_ORIENTATION_SQUARE() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#IMA_ORIENTATION_UNSET() = 0` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#ImaAdTagUriBuilder(android.net.Uri)(uri: https://developer.android.com/reference/android/net/Uri.html!)` Creates a new instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#build()()` Builds a URI with the builder's current values. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder#setPreferredLinearOrientation(int)( @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder.ImaOrientationType preferredLinearOrientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Sets the preferred linear orientation to be used. |

## Constants

### IMA_ORIENTATION_LANDSCAPE

```
const val IMA_ORIENTATION_LANDSCAPE = 1: Int
```

### IMA_ORIENTATION_PORTRAIT

```
const val IMA_ORIENTATION_PORTRAIT = 2: Int
```

### IMA_ORIENTATION_SQUARE

```
const val IMA_ORIENTATION_SQUARE = 3: Int
```

### IMA_ORIENTATION_UNSET

```
const val IMA_ORIENTATION_UNSET = 0: Int
```

## Public constructors

### ImaAdTagUriBuilder

```
ImaAdTagUriBuilder(uri: Uri!)
```

Creates a new instance.

| Parameters |
|---|---|
| `uri: https://developer.android.com/reference/android/net/Uri.html!` | The URI. |

## Public functions

### build

```
fun build(): Uri!
```

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

| Returns |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html!` | The build `https://developer.android.com/reference/android/net/Uri.html`. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If the builder has missing or invalid inputs. |

### setPreferredLinearOrientation

```
@CanIgnoreReturnValue
fun setPreferredLinearOrientation(
    @ImaAdTagUriBuilder.ImaOrientationType preferredLinearOrientation: Int
): ImaAdTagUriBuilder!
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder.ImaOrientationType preferredLinearOrientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The preferred linear orientation. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaAdTagUriBuilder!` | This instance, for convenience. |