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

*** ** * ** ***


```
public final class ExoPlayerTestRunner.Builder
```

<br />

*** ** * ** ***

Builder to set-up an `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner`. Default fake implementations will be used for unset test properties.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#Builder(android.content.Context)(https://developer.android.com/reference/android/content/Context.html context)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner` | `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#build()()` Builds an `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner` using the provided values or their defaults. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#initialSeek(int,long)(int mediaItemIndex, long positionMs)` Seeks before setting the media sources and preparing the player. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setActionSchedule(androidx.media3.test.utils.ActionSchedule)(https://developer.android.com/reference/androidx/media3/test/utils/ActionSchedule actionSchedule)` Sets an `https://developer.android.com/reference/androidx/media3/test/utils/ActionSchedule` to be run by the test runner. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setAnalyticsListener(androidx.media3.exoplayer.analytics.AnalyticsListener)(https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener analyticsListener)` Sets an `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener` to be registered. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setBandwidthMeter(androidx.media3.exoplayer.upstream.BandwidthMeter)(https://developer.android.com/reference/androidx/media3/exoplayer/upstream/BandwidthMeter bandwidthMeter)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setClock(androidx.media3.common.util.Clock)(https://developer.android.com/reference/androidx/media3/common/util/Clock clock)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setExpectedPlayerEndedCount(int)(int expectedPlayerEndedCount)` Sets the number of times the test runner is expected to reach the `https://developer.android.com/reference/androidx/media3/common/Player#STATE_ENDED()` or `https://developer.android.com/reference/androidx/media3/common/Player#STATE_IDLE()`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setLoadControl(androidx.media3.exoplayer.LoadControl)(https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl loadControl)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setManifest(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html manifest)` Sets a manifest to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)(MediaSource[] mediaSources)` Sets the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be used by the test runner. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setPauseAtEndOfMediaItems(boolean)(boolean pauseAtEndOfMediaItems)` Sets whether to enable pausing at the end of media items. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setPlayerListener(androidx.media3.common.Player.Listener)(https://developer.android.com/reference/androidx/media3/common/Player.Listener playerListener)` Sets an `https://developer.android.com/reference/androidx/media3/common/Player.Listener` to be registered to listen to player events. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setPreloadConfiguration(androidx.media3.exoplayer.ExoPlayer.PreloadConfiguration)( https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer.PreloadConfiguration preloadConfiguration )` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setRenderers(androidx.media3.exoplayer.Renderer...)(Renderer[] renderers)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setRenderersFactory(androidx.media3.exoplayer.RenderersFactory)(https://developer.android.com/reference/androidx/media3/exoplayer/RenderersFactory renderersFactory)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setSupportedFormats(androidx.media3.common.Format...)(Format[] supportedFormats)` Sets a list of `https://developer.android.com/reference/androidx/media3/common/Format`s to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` to create media periods. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setTimeline(androidx.media3.common.Timeline)(https://developer.android.com/reference/androidx/media3/common/Timeline timeline)` Sets a `https://developer.android.com/reference/androidx/media3/common/Timeline` to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setTrackSelector(androidx.media3.exoplayer.trackselection.DefaultTrackSelector)(https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector trackSelector)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setUseLazyPreparation(boolean)(boolean useLazyPreparation)` |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setVideoSurface(android.view.Surface)(https://developer.android.com/reference/android/view/Surface.html surface)` Sets the video `https://developer.android.com/reference/android/view/Surface.html`. |
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#skipSettingMediaSources()()` Skips calling `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer#setMediaSources(java.util.List<androidx.media3.exoplayer.source.MediaSource>)` before preparing. |

## Public constructors

### Builder

```
public Builder(Context context)
```

## Public methods

### build

```
public ExoPlayerTestRunner build()
```

Builds an `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner` using the provided values or their defaults.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner` | The built `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner`. |

### initialSeek

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder initialSeek(int mediaItemIndex, long positionMs)
```

Seeks before setting the media sources and preparing the player.

| Parameters |
|---|---|
| `int mediaItemIndex` | The media item index to seek to. |
| `long positionMs` | The position in milliseconds to seek to. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setActionSchedule

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setActionSchedule(ActionSchedule actionSchedule)
```

Sets an `https://developer.android.com/reference/androidx/media3/test/utils/ActionSchedule` to be run by the test runner. The first action will be executed immediately before `https://developer.android.com/reference/androidx/media3/common/Player#prepare()`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ActionSchedule actionSchedule` | An `https://developer.android.com/reference/androidx/media3/test/utils/ActionSchedule` to be used by the test runner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setAnalyticsListener

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setAnalyticsListener(AnalyticsListener analyticsListener)
```

Sets an `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener` to be registered.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener analyticsListener` | An `https://developer.android.com/reference/androidx/media3/exoplayer/analytics/AnalyticsListener` to be registered. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setBandwidthMeter

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setBandwidthMeter(BandwidthMeter bandwidthMeter)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setBandwidthMeter(androidx.media3.exoplayer.upstream.BandwidthMeter)` |   |

### setClock

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setClock(Clock clock)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setClock(androidx.media3.common.util.Clock)` |   |

### setExpectedPlayerEndedCount

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setExpectedPlayerEndedCount(int expectedPlayerEndedCount)
```

Sets the number of times the test runner is expected to reach the `https://developer.android.com/reference/androidx/media3/common/Player#STATE_ENDED()` or `https://developer.android.com/reference/androidx/media3/common/Player#STATE_IDLE()`. The default is 1. This affects how long `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner#blockUntilEnded(long)` waits.

| Parameters |
|---|---|
| `int expectedPlayerEndedCount` | The number of times the player is expected to reach the ended or idle state. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setLoadControl

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setLoadControl(LoadControl loadControl)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setLoadControl(androidx.media3.exoplayer.LoadControl)` |   |

### setManifest

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setManifest(Object manifest)
```

Sets a manifest to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. The default value is null. Setting the manifest is not allowed after a call to `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)` or `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#skipSettingMediaSources()`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html manifest` | A manifest to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setMediaSources

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setMediaSources(MediaSource[] mediaSources)
```

Sets the `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be used by the test runner. The default value is a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` with the timeline and manifest provided by `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setTimeline(androidx.media3.common.Timeline)` and `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setManifest(java.lang.Object)`. Setting media sources is not allowed after calls to `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#skipSettingMediaSources()`, `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setTimeline(androidx.media3.common.Timeline)` and/or `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setManifest(java.lang.Object)`.

| Parameters |
|---|---|
| `MediaSource[] mediaSources` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource`s to be used by the test runner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setPauseAtEndOfMediaItems

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setPauseAtEndOfMediaItems(boolean pauseAtEndOfMediaItems)
```

Sets whether to enable pausing at the end of media items.

| Parameters |
|---|---|
| `boolean pauseAtEndOfMediaItems` | Whether to pause at the end of media items. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setPlayerListener

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setPlayerListener(Player.Listener playerListener)
```

Sets an `https://developer.android.com/reference/androidx/media3/common/Player.Listener` to be registered to listen to player events.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Player.Listener playerListener` | A `https://developer.android.com/reference/androidx/media3/common/Player.Listener` to be registered by the test runner to listen to player events. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setPreloadConfiguration

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setPreloadConfiguration(
    ExoPlayer.PreloadConfiguration preloadConfiguration
)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer#setPreloadConfiguration(androidx.media3.exoplayer.ExoPlayer.PreloadConfiguration)` |   |

### setRenderers

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setRenderers(Renderer[] renderers)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setRenderers(androidx.media3.exoplayer.Renderer...)` |   |

### setRenderersFactory

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setRenderersFactory(RenderersFactory renderersFactory)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setRenderersFactory(androidx.media3.exoplayer.RenderersFactory)` |   |

### setSupportedFormats

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setSupportedFormats(Format[] supportedFormats)
```

Sets a list of `https://developer.android.com/reference/androidx/media3/common/Format`s to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` to create media periods. The default value is a single `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner#VIDEO_FORMAT()`. Note that this parameter doesn't have any influence if a media source with `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)` is set.

| Parameters |
|---|---|
| `Format[] supportedFormats` | A list of supported `https://developer.android.com/reference/androidx/media3/common/Format`s. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setTimeline

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setTimeline(Timeline timeline)
```

Sets a `https://developer.android.com/reference/androidx/media3/common/Timeline` to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. The default value is a seekable, non-dynamic `https://developer.android.com/reference/androidx/media3/test/utils/FakeTimeline` with a duration of `https://developer.android.com/reference/androidx/media3/test/utils/FakeTimeline.TimelineWindowDefinition#DEFAULT_WINDOW_DURATION_US()`. Setting the timeline is not allowed after a call to `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)` or `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#skipSettingMediaSources()`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Timeline timeline` | A `https://developer.android.com/reference/androidx/media3/common/Timeline` to be used by a `https://developer.android.com/reference/androidx/media3/test/utils/FakeMediaSource` in the test runner. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### setTrackSelector

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setTrackSelector(DefaultTrackSelector trackSelector)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setTrackSelector(androidx.media3.exoplayer.trackselection.DefaultTrackSelector)` |   |

### setUseLazyPreparation

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setUseLazyPreparation(boolean useLazyPreparation)
```

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/TestExoPlayerBuilder#setUseLazyPreparation(boolean)` |   |

### setVideoSurface

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder setVideoSurface(Surface surface)
```

Sets the video `https://developer.android.com/reference/android/view/Surface.html`. The default value is `null`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/Surface.html surface` | The `https://developer.android.com/reference/android/view/Surface.html` to be used by the player. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |

### skipSettingMediaSources

```
@CanIgnoreReturnValue
public ExoPlayerTestRunner.Builder skipSettingMediaSources()
```

Skips calling `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer#setMediaSources(java.util.List<androidx.media3.exoplayer.source.MediaSource>)` before preparing. Calling this method is not allowed after calls to `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setMediaSources(androidx.media3.exoplayer.source.MediaSource...)`, `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setTimeline(androidx.media3.common.Timeline)` and/or `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder#setManifest(java.lang.Object)`.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/ExoPlayerTestRunner.Builder` | This builder. |