# ImaServerSideAdInsertionMediaSource.AdsLoader

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/ImaServerSideAdInsertionMediaSource.java+class:androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.AdsLoader)

*** ** * ** ***

<br />

```
class ImaServerSideAdInsertionMediaSource.AdsLoader
```

<br />

*** ** * ** ***

An ads loader for IMA server side ad insertion streams.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.Builder` Builder for building an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader`. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.State` The state of the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader` that can be used when resuming from the background. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#focusSkipButton()()` Puts the focus on the skip button, if a skip button is present and an ad is playing. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.State!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#release()()` Releases resources. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#replaceAdTagParameters(java.util.Map<java.lang.String,java.lang.String>)(adTagParameters: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` Replaces all the ad tag parameters used for the upcoming ad requests for a live stream. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#setPlayer(androidx.media3.common.Player)(player: https://developer.android.com/reference/kotlin/androidx/media3/common/Player!)` Sets the player. |

## Public functions

### focusSkipButton

```
@UnstableApi
fun focusSkipButton(): Unit
```

Puts the focus on the skip button, if a skip button is present and an ad is playing.

| See also |
|---|---|
| `https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/BaseManager.html#focus--` |   |

### release

```
fun release(): ImaServerSideAdInsertionMediaSource.AdsLoader.State!
```

Releases resources.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.State!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.State` that can be used when resuming from the background. |

### replaceAdTagParameters

```
@UnstableApi
fun replaceAdTagParameters(adTagParameters: (Mutable)Map<String!, String!>!): Unit
```

Replaces all the ad tag parameters used for the upcoming ad requests for a live stream.

| See also |
|---|---|
| `https://developers.google.com/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/StreamManager.html#replaceAdTagParameters-java.util.Map&lt;java.lang.String,java.lang.String&gt;-` | ,) |

### setPlayer

```
fun setPlayer(player: Player!): Unit
```

Sets the player.

This method needs to be called before adding server side ad insertion media items to the player.