# Action.WaitForTimelineChanged

# Action.WaitForTimelineChanged

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/Action.WaitForTimelineChanged "View this page in Java")

<br />

```
class Action.WaitForTimelineChanged : Action
```

<br />

|---|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                                                                        |||
| ↳ | [androidx.media3.test.utils.Action](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action)                                                  ||
|   | ↳ | [androidx.media3.test.utils.Action.WaitForTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.WaitForTimelineChanged) |

*** ** * ** ***

Waits for[onTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.Listener#onTimelineChanged(androidx.media3.common.Timeline,int)).

## Summary

|                                                                                                                                                                                                                                                                                                                                                           ### Public constructors                                                                                                                                                                                                                                                                                                                                                           |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WaitForTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.WaitForTimelineChanged#WaitForTimelineChanged(java.lang.String))`(tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!)` Creates action waiting for any timeline change for any reason.                                                                                                                                                                                                                                                                                                                                                                                                      |
| [WaitForTimelineChanged](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.WaitForTimelineChanged#WaitForTimelineChanged(java.lang.String,androidx.media3.common.Timeline,int))`(` ` tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!,` ` expectedTimeline: `[Timeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline)`?,` ` @`[Player.TimelineChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason)` expectedReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Creates action waiting for a timeline change for a given reason. |

|                            ### Protected functions                            |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [doActionImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action.WaitForTimelineChanged#doActionImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface))`(` ` player: `[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)`!,` ` trackSelector: `[DefaultTrackSelector](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/DefaultTrackSelector)`!,` ` surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?` `)` Called by[doActionAndScheduleNextImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode))to perform the action. |

## Public constructors

### WaitForTimelineChanged

```
WaitForTimelineChanged(tag: String!)
```

Creates action waiting for any timeline change for any reason.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|---------------------------|
| `tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | A tag to use for logging. |

### WaitForTimelineChanged

```
WaitForTimelineChanged(
    tag: String!,
    expectedTimeline: Timeline?,
    @Player.TimelineChangeReason expectedReason: Int
)
```

Creates action waiting for a timeline change for a given reason.  

|                                                                                                            Parameters                                                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| `tag: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                                                                       | A tag to use for logging.                                         |
| `expectedTimeline: `[Timeline](https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline)`?`                                                                                                                 | The expected timeline or`null`if any timeline change is relevant. |
| `@`[Player.TimelineChangeReason](https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason)` expectedReason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The expected timeline change reason.                              |

## Protected functions

### doActionImpl

```
protected fun doActionImpl(
    player: ExoPlayer!,
    trackSelector: DefaultTrackSelector!,
    surface: Surface?
): Unit
```

Called by[doActionAndScheduleNextImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action#doActionAndScheduleNextImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface,androidx.media3.common.util.HandlerWrapper,androidx.media3.test.utils.ActionSchedule.ActionNode))to perform the action.  

|                                                                        Parameters                                                                        |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------|
| `player: `[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)`!`                                             | The player to which the action should be applied.                          |
| `trackSelector: `[DefaultTrackSelector](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/DefaultTrackSelector)`!` | The track selector to which the action should be applied.                  |
| `surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?`                                                               | The surface to use when applying actions, or`null`if no surface is needed. |