# ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater

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

*** ** * ** ***


```
interface ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater
```

<br />

*** ** * ** ***

Receives ad playback state update requests when the `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` of the content media source has changed.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater#onAdPlaybackStateUpdateRequested(androidx.media3.common.Timeline)(contentTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!)` Called when the content source has refreshed the timeline. |

## Public functions

### onAdPlaybackStateUpdateRequested

```
fun onAdPlaybackStateUpdateRequested(contentTimeline: Timeline!): Boolean
```

Called when the content source has refreshed the timeline.

If true is returned the source refresh publication is deferred, to wait for an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionMediaSource#setAdPlaybackStates(com.google.common.collect.ImmutableMap<java.lang.Object,androidx.media3.common.AdPlaybackState>,androidx.media3.common.Timeline)`. If false is returned, the source refresh is immediately published.

Called on the playback thread.

| Parameters |
|---|---|
| `contentTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline` of the wrapped content media source. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to defer the source refresh publication, or false to immediately publish the source refresh. |