# Action.Prepare

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.Prepare)

*** ** * ** ***


```
public final class Action.Prepare extends Action
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.test.utils.Action](https://developer.android.com/reference/androidx/media3/test/utils/Action) ||
|   | ↳ | [androidx.media3.test.utils.Action.Prepare](https://developer.android.com/reference/androidx/media3/test/utils/Action.Prepare) |

*** ** * ** ***

Calls `https://developer.android.com/reference/androidx/media3/common/Player#prepare()`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/test/utils/Action.Prepare#Prepare(java.lang.String)(https://developer.android.com/reference/java/lang/String.html tag)` |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/test/utils/Action.Prepare#doActionImpl(androidx.media3.exoplayer.ExoPlayer,androidx.media3.exoplayer.trackselection.DefaultTrackSelector,android.view.Surface)( https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player, https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector trackSelector, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Surface.html surface )` Called by `https://developer.android.com/reference/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

### Prepare

```
public Prepare(String tag)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html tag` | A tag to use for logging. |

## Protected methods

### doActionImpl

```
protected void doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)
```

Called by `https://developer.android.com/reference/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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer player` | The player to which the action should be applied. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector trackSelector` | The track selector to which the action should be applied. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/view/Surface.html surface` | The surface to use when applying actions, or `null` if no surface is needed. |