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

*** ** * ** ***


```
public interface ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/ads/ServerSideAdInsertionMediaSource.AdPlaybackStateUpdater#onAdPlaybackStateUpdateRequested(androidx.media3.common.Timeline)(https://developer.android.com/reference/androidx/media3/common/Timeline contentTimeline)` Called when the content source has refreshed the timeline. |

## Public methods

### onAdPlaybackStateUpdateRequested

```
abstract boolean onAdPlaybackStateUpdateRequested(Timeline contentTimeline)
```

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/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Timeline contentTimeline` | The `https://developer.android.com/reference/androidx/media3/common/Timeline` of the wrapped content media source. |

| Returns |
|---|---|
| `boolean` | true to defer the source refresh publication, or false to immediately publish the source refresh. |