# 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 />

```
public final class ImaServerSideAdInsertionMediaSource.AdsLoader
```

<br />

*** ** * ** ***

An ads loader for IMA server side ad insertion streams.

## Summary

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

| ### Public methods |
|---|---|
| `void` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/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/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader.State` | `https://developer.android.com/reference/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#release()()` Releases resources. |
| `void` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#replaceAdTagParameters(java.util.Map<java.lang.String,java.lang.String>)(https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html> adTagParameters)` Replaces all the ad tag parameters used for the upcoming ad requests for a live stream. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/ima/ImaServerSideAdInsertionMediaSource.AdsLoader#setPlayer(androidx.media3.common.Player)(https://developer.android.com/reference/androidx/media3/common/Player player)` Sets the player. |

## Public methods

### focusSkipButton

```
@UnstableApi
public void focusSkipButton()
```

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

```
public ImaServerSideAdInsertionMediaSource.AdsLoader.State release()
```

Releases resources.

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

### replaceAdTagParameters

```
@UnstableApi
public void replaceAdTagParameters(Map<String, String> adTagParameters)
```

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

```
public void setPlayer(Player player)
```

Sets the player.

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