# ActionSchedule.Builder

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/ActionSchedule.java+class:androidx.media3.test.utils.ActionSchedule.Builder)

*** ** * ** ***


```
class ActionSchedule.Builder
```

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#Builder(java.lang.String)(tag: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#addMediaSources(androidx.media3.exoplayer.source.MediaSource...)(mediaSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!)` Schedules a add media items action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#apply(androidx.media3.test.utils.Action)(action: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action!)` Schedules an action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#build()()` Builds the schedule. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#clearMediaItems()()` Schedules a clear media items action to be created. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#clearVideoSurface()()` Schedules a clear video surface action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#delay(long)(delayMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules a delay between executing any previous actions and any subsequent ones. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#disableRenderer(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a renderer disable action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#enableRenderer(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a renderer enable action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#executeRunnable(java.lang.Runnable)(runnable: https://developer.android.com/reference/java/lang/Runnable.html!)` Schedules a `https://developer.android.com/reference/java/lang/Runnable.html`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#moveMediaItem(int,int)(currentIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, newIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a move media item action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#pause()()` Schedules a pause action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#play()()` Schedules a play action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#playUntilPosition(int,long)(mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules a play action, waits until the player reaches the specified position, and pauses the player again. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#playUntilStartOfMediaItem(int)(mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a play action, waits until the player reaches the start of the specified media item, and pauses the player again. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#prepare()()` Schedules a prepare action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#removeMediaItem(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a remove media item action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#removeMediaItems(int,int)(fromIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, toIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a remove media items action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#repeat(androidx.media3.test.utils.Action,long)(action: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action!, intervalMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules an action repeatedly. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#seek(long)(positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules a seek action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#seek(int,long)(mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules a seek action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#seek(int,long,boolean)( mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, catchIllegalSeekException: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Schedules a seek action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#seekAndWait(long)(positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules a seek action and waits until playback resumes after the seek. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#sendMessage(androidx.media3.exoplayer.PlayerMessage.Target,long)(target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Schedules sending a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#sendMessage(androidx.media3.exoplayer.PlayerMessage.Target,int,long)( target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!, mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html )` Schedules sending a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#sendMessage(androidx.media3.exoplayer.PlayerMessage.Target,int,long,boolean)( target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!, mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, deleteAfterDelivery: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Schedules to send a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setAudioAttributes(androidx.media3.common.AudioAttributes,boolean)( audioAttributes: https://developer.android.com/reference/kotlin/androidx/media3/common/AudioAttributes!, handleAudioFocus: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Schedules application of audio attributes. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)(mediaSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!)` Schedules a set media items action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setMediaSources(boolean,androidx.media3.exoplayer.source.MediaSource...)(resetPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, sources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!)` Schedules a set media sources action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setMediaSources(int,long,androidx.media3.exoplayer.source.MediaSource...)( mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, sources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>! )` Schedules a set media source actions to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setPlaybackParameters(androidx.media3.common.PlaybackParameters)(playbackParameters: https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackParameters!)` Schedules a playback parameters setting action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setRepeatMode(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.RepeatMode repeatMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a repeat mode setting action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setShuffleModeEnabled(boolean)(shuffleModeEnabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Schedules a shuffle setting action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setShuffleOrder(androidx.media3.exoplayer.source.ShuffleOrder)(shuffleOrder: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ShuffleOrder!)` Schedules a set shuffle order action to be executed. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#setVideoSurface()()` Schedules a set video surface action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#stop()()` Schedules a stop action. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#throwPlaybackException(androidx.media3.exoplayer.ExoPlaybackException)(exception: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlaybackException!)` Schedules to throw a playback exception on the playback thread. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForIsLoading(boolean)(targetIsLoading: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Schedules a delay until `player.isLoading()` changes to the specified value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForMessage(androidx.media3.test.utils.ActionSchedule.PlayerTarget)(playerTarget: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.PlayerTarget!)` Schedules a delay until a message arrives at the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForPendingPlayerCommands()()` Schedules a delay until all pending player commands have been handled. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForPlayWhenReady(boolean)(targetPlayWhenReady: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Schedules a delay until playWhenReady has the specified value. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForPlaybackState(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State targetPlaybackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Schedules a delay until the playback state changed to the specified state. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForPositionDiscontinuity()()` Schedules a delay until the next position discontinuity. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForTimelineChanged()()` Schedules a delay until any timeline change. |
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder#waitForTimelineChanged(androidx.media3.common.Timeline,int)( expectedTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!, @https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason expectedReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Schedules a delay until the timeline changed to a specified expected timeline. |

## Public constructors

### Builder

```
Builder(tag: String!)
```

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

## Public functions

### addMediaSources

```
@CanIgnoreReturnValue
fun addMediaSources(mediaSources: Array<MediaSource!>!): ActionSchedule.Builder!
```

Schedules a add media items action to be executed.

| Parameters |
|---|---|
| `mediaSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!` | The media sources to add. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### apply

```
@CanIgnoreReturnValue
fun apply(action: Action!): ActionSchedule.Builder!
```

Schedules an action.

| Parameters |
|---|---|
| `action: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action!` | The action to schedule. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### build

```
fun build(): ActionSchedule!
```

Builds the schedule.

### clearMediaItems

```
@CanIgnoreReturnValue
fun clearMediaItems(): ActionSchedule.Builder!
```

Schedules a clear media items action to be created.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder. for convenience, |

### clearVideoSurface

```
@CanIgnoreReturnValue
fun clearVideoSurface(): ActionSchedule.Builder!
```

Schedules a clear video surface action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### delay

```
@CanIgnoreReturnValue
fun delay(delayMs: Long): ActionSchedule.Builder!
```

Schedules a delay between executing any previous actions and any subsequent ones.

| Parameters |
|---|---|
| `delayMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The delay in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### disableRenderer

```
@CanIgnoreReturnValue
fun disableRenderer(index: Int): ActionSchedule.Builder!
```

Schedules a renderer disable action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### enableRenderer

```
@CanIgnoreReturnValue
fun enableRenderer(index: Int): ActionSchedule.Builder!
```

Schedules a renderer enable action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### executeRunnable

```
@CanIgnoreReturnValue
fun executeRunnable(runnable: Runnable!): ActionSchedule.Builder!
```

Schedules a `https://developer.android.com/reference/java/lang/Runnable.html`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### moveMediaItem

```
@CanIgnoreReturnValue
fun moveMediaItem(currentIndex: Int, newIndex: Int): ActionSchedule.Builder!
```

Schedules a move media item action to be executed.

| Parameters |
|---|---|
| `currentIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The current index of the item to move. |
| `newIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index after the item has been moved. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### pause

```
@CanIgnoreReturnValue
fun pause(): ActionSchedule.Builder!
```

Schedules a pause action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### play

```
@CanIgnoreReturnValue
fun play(): ActionSchedule.Builder!
```

Schedules a play action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### playUntilPosition

```
@CanIgnoreReturnValue
fun playUntilPosition(mediaItemIndex: Int, positionMs: Long): ActionSchedule.Builder!
```

Schedules a play action, waits until the player reaches the specified position, and pauses the player again.

| Parameters |
|---|---|
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item index at which the player should be paused again. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The position in that media item at which the player should be paused again. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### playUntilStartOfMediaItem

```
@CanIgnoreReturnValue
fun playUntilStartOfMediaItem(mediaItemIndex: Int): ActionSchedule.Builder!
```

Schedules a play action, waits until the player reaches the start of the specified media item, and pauses the player again.

| Parameters |
|---|---|
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item index at which the player should be paused again. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### prepare

```
@CanIgnoreReturnValue
fun prepare(): ActionSchedule.Builder!
```

Schedules a prepare action to be executed.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### removeMediaItem

```
@CanIgnoreReturnValue
fun removeMediaItem(index: Int): ActionSchedule.Builder!
```

Schedules a remove media item action to be executed.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The index of the media item to be removed. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### removeMediaItems

```
@CanIgnoreReturnValue
fun removeMediaItems(fromIndex: Int, toIndex: Int): ActionSchedule.Builder!
```

Schedules a remove media items action to be executed.

| Parameters |
|---|---|
| `fromIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The start of the range of media items to be removed. |
| `toIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The end of the range of media items to be removed (exclusive). |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### repeat

```
@CanIgnoreReturnValue
fun repeat(action: Action!, intervalMs: Long): ActionSchedule.Builder!
```

Schedules an action repeatedly.

| Parameters |
|---|---|
| `action: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/Action!` | The action to schedule. |
| `intervalMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The interval between each repetition in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### seek

```
@CanIgnoreReturnValue
fun seek(positionMs: Long): ActionSchedule.Builder!
```

Schedules a seek action.

| Parameters |
|---|---|
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### seek

```
@CanIgnoreReturnValue
fun seek(mediaItemIndex: Int, positionMs: Long): ActionSchedule.Builder!
```

Schedules a seek action.

| Parameters |
|---|---|
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item to seek to. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### seek

```
@CanIgnoreReturnValue
fun seek(
    mediaItemIndex: Int,
    positionMs: Long,
    catchIllegalSeekException: Boolean
): ActionSchedule.Builder!
```

Schedules a seek action to be executed.

| Parameters |
|---|---|
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item to seek to. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek position. |
| `catchIllegalSeekException: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether an illegal seek position should be caught or not. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### seekAndWait

```
fun seekAndWait(positionMs: Long): ActionSchedule.Builder!
```

Schedules a seek action and waits until playback resumes after the seek.

| Parameters |
|---|---|
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The seek position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### sendMessage

```
@CanIgnoreReturnValue
fun sendMessage(target: PlayerMessage.Target!, positionMs: Long): ActionSchedule.Builder!
```

Schedules sending a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`.

| Parameters |
|---|---|
| `target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!` | A message target. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The position in the current media item at which the message should be sent, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### sendMessage

```
@CanIgnoreReturnValue
fun sendMessage(
    target: PlayerMessage.Target!,
    mediaItemIndex: Int,
    positionMs: Long
): ActionSchedule.Builder!
```

Schedules sending a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`.

| Parameters |
|---|---|
| `target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!` | A message target. |
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item index at which the message should be sent. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The position at which the message should be sent, in milliseconds. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### sendMessage

```
@CanIgnoreReturnValue
fun sendMessage(
    target: PlayerMessage.Target!,
    mediaItemIndex: Int,
    positionMs: Long,
    deleteAfterDelivery: Boolean
): ActionSchedule.Builder!
```

Schedules to send a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage`.

| Parameters |
|---|---|
| `target: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target!` | A message target. |
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item index at which the message should be sent. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The position at which the message should be sent, in milliseconds. |
| `deleteAfterDelivery: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the message will be deleted after delivery. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setAudioAttributes

```
@CanIgnoreReturnValue
fun setAudioAttributes(
    audioAttributes: AudioAttributes!,
    handleAudioFocus: Boolean
): ActionSchedule.Builder!
```

Schedules application of audio attributes.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setMediaSources

```
@CanIgnoreReturnValue
fun setMediaSources(mediaSources: Array<MediaSource!>!): ActionSchedule.Builder!
```

Schedules a set media items action to be executed.

| Parameters |
|---|---|
| `mediaSources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!` | The media sources to add. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setMediaSources

```
@CanIgnoreReturnValue
fun setMediaSources(resetPosition: Boolean, sources: Array<MediaSource!>!): ActionSchedule.Builder!
```

Schedules a set media sources action to be executed.

| Parameters |
|---|---|
| `resetPosition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the playback position should be reset. |
| `sources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!` | The media sources to be set on the player. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setMediaSources

```
@CanIgnoreReturnValue
fun setMediaSources(
    mediaItemIndex: Int,
    positionMs: Long,
    sources: Array<MediaSource!>!
): ActionSchedule.Builder!
```

Schedules a set media source actions to be executed.

| Parameters |
|---|---|
| `mediaItemIndex: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The media item index to start playback from or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` if the playback position should not be reset. |
| `positionMs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The position in milliseconds from where playback should start. If `https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET()` is passed the default position is used. In any case, if ` mediaItemIndex` is set to `https://developer.android.com/reference/kotlin/androidx/media3/common/C#INDEX_UNSET()` the position is not reset at all and this parameter is ignored. |
| `sources: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!>!` | The media sources to be set on the player. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setPlaybackParameters

```
@CanIgnoreReturnValue
fun setPlaybackParameters(playbackParameters: PlaybackParameters!): ActionSchedule.Builder!
```

Schedules a playback parameters setting action.

| Parameters |
|---|---|
| `playbackParameters: https://developer.android.com/reference/kotlin/androidx/media3/common/PlaybackParameters!` | The playback parameters to set. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Player#setPlaybackParameters(androidx.media3.common.PlaybackParameters)` |   |

### setRepeatMode

```
@CanIgnoreReturnValue
fun setRepeatMode(@Player.RepeatMode repeatMode: Int): ActionSchedule.Builder!
```

Schedules a repeat mode setting action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setShuffleModeEnabled

```
@CanIgnoreReturnValue
fun setShuffleModeEnabled(shuffleModeEnabled: Boolean): ActionSchedule.Builder!
```

Schedules a shuffle setting action to be executed.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setShuffleOrder

```
@CanIgnoreReturnValue
fun setShuffleOrder(shuffleOrder: ShuffleOrder!): ActionSchedule.Builder!
```

Schedules a set shuffle order action to be executed.

| Parameters |
|---|---|
| `shuffleOrder: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ShuffleOrder!` | The shuffle order. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### setVideoSurface

```
@CanIgnoreReturnValue
fun setVideoSurface(): ActionSchedule.Builder!
```

Schedules a set video surface action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### stop

```
@CanIgnoreReturnValue
fun stop(): ActionSchedule.Builder!
```

Schedules a stop action.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### throwPlaybackException

```
@CanIgnoreReturnValue
fun throwPlaybackException(exception: ExoPlaybackException!): ActionSchedule.Builder!
```

Schedules to throw a playback exception on the playback thread.

| Parameters |
|---|---|
| `exception: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlaybackException!` | The exception to throw. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForIsLoading

```
@CanIgnoreReturnValue
fun waitForIsLoading(targetIsLoading: Boolean): ActionSchedule.Builder!
```

Schedules a delay until `player.isLoading()` changes to the specified value.

| Parameters |
|---|---|
| `targetIsLoading: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | The target value of `player.isLoading()`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForMessage

```
@CanIgnoreReturnValue
fun waitForMessage(playerTarget: ActionSchedule.PlayerTarget!): ActionSchedule.Builder!
```

Schedules a delay until a message arrives at the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/PlayerMessage.Target`.

| Parameters |
|---|---|
| `playerTarget: https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.PlayerTarget!` | The target to observe. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForPendingPlayerCommands

```
@CanIgnoreReturnValue
fun waitForPendingPlayerCommands(): ActionSchedule.Builder!
```

Schedules a delay until all pending player commands have been handled.

A command is considered as having been handled if it arrived on the playback thread and the player acknowledged that it received the command back to the app thread.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForPlayWhenReady

```
@CanIgnoreReturnValue
fun waitForPlayWhenReady(targetPlayWhenReady: Boolean): ActionSchedule.Builder!
```

Schedules a delay until playWhenReady has the specified value.

| Parameters |
|---|---|
| `targetPlayWhenReady: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | The target playWhenReady value. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForPlaybackState

```
@CanIgnoreReturnValue
fun waitForPlaybackState(@Player.State targetPlaybackState: Int): ActionSchedule.Builder!
```

Schedules a delay until the playback state changed to the specified state.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.State targetPlaybackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The target playback state. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForPositionDiscontinuity

```
@CanIgnoreReturnValue
fun waitForPositionDiscontinuity(): ActionSchedule.Builder!
```

Schedules a delay until the next position discontinuity.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForTimelineChanged

```
@CanIgnoreReturnValue
fun waitForTimelineChanged(): ActionSchedule.Builder!
```

Schedules a delay until any timeline change.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |

### waitForTimelineChanged

```
@CanIgnoreReturnValue
fun waitForTimelineChanged(
    expectedTimeline: Timeline!,
    @Player.TimelineChangeReason expectedReason: Int
): ActionSchedule.Builder!
```

Schedules a delay until the timeline changed to a specified expected timeline.

| Parameters |
|---|---|
| `expectedTimeline: https://developer.android.com/reference/kotlin/androidx/media3/common/Timeline!` | The expected timeline. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/common/Player.TimelineChangeReason expectedReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The expected reason of the timeline change. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/ActionSchedule.Builder!` | The builder, for convenience. |