> Documentation index: https://developer.android.com/reference/llms.txt

# ExoTrackSelection.Factory

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/trackselection/ExoTrackSelection.java+class:androidx.media3.exoplayer.trackselection.ExoTrackSelection.Factory)

*** ** * ** ***


```
interface ExoTrackSelection.Factory
```

<br />

Known direct subclasses [AdaptiveTrackSelection.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.Factory.md.txt), [FakeTrackSelector.FakeTrackSelectionFactory](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/FakeTrackSelector.FakeTrackSelectionFactory.md.txt), [RandomTrackSelection.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/trackselection/RandomTrackSelection.Factory.md.txt)

|---|---|
| `AdaptiveTrackSelection.Factory` | Factory for `AdaptiveTrackSelection` instances. |
| `FakeTrackSelector.FakeTrackSelectionFactory` | A factory for the `androidx.media3.test.utils.FakeTrackSelection` instances requested by the `FakeTrackSelector`. |
| `RandomTrackSelection.Factory` | Factory for `RandomTrackSelection` instances. |

*** ** * ** ***

Factory for `ExoTrackSelection` instances.

## Summary

| ### Public functions |
|---|---|
| `Array<ExoTrackSelection?>?` | `createTrackSelections( definitions: Array<ExoTrackSelection.Definition?>?, bandwidthMeter: BandwidthMeter!, mediaPeriodId: MediaSource.MediaPeriodId!, timeline: Timeline! )` Creates track selections for the provided `Definitions`. |

## Public functions

### createTrackSelections

```
fun createTrackSelections(
    definitions: Array<ExoTrackSelection.Definition?>?,
    bandwidthMeter: BandwidthMeter!,
    mediaPeriodId: MediaSource.MediaPeriodId!,
    timeline: Timeline!
): Array<ExoTrackSelection?>?
```

Creates track selections for the provided `Definitions`.

Implementations that create at most one adaptive track selection may use `createTrackSelectionsForDefinitions`.

| Parameters |
|---|---|
| `definitions: Array<ExoTrackSelection.Definition?>?` | A `Definition` array. May include null values. |
| `bandwidthMeter: BandwidthMeter!` | A `BandwidthMeter` which can be used to select tracks. |
| `mediaPeriodId: MediaSource.MediaPeriodId!` | The `MediaPeriodId` of the period for which tracks are to be selected. |
| `timeline: Timeline!` | The `Timeline` holding the period for which tracks are to be selected. |

| Returns |
|---|---|
| `Array<ExoTrackSelection?>?` | The created selections. Must have the same length as `definitions` and may include null values. |