Package com.google.android.exoplayer2.trackselection

## Class RandomTrackSelection.Factory

- java.lang.Object
- - com.google.android.exoplayer2.trackselection.RandomTrackSelection.Factory

- All Implemented Interfaces:
    `ExoTrackSelection.Factory`
  Enclosing class:
    RandomTrackSelection

      public static final class RandomTrackSelection.Factory
      extends Object
      implements ExoTrackSelection.Factory

  Factory for `RandomTrackSelection` instances.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Factory()` |
    `Factory​(int seed)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `@NullableType ExoTrackSelection[]` | `createTrackSelections​(@NullableType ExoTrackSelection.Definition[] definitions, BandwidthMeter bandwidthMeter, MediaSource.MediaPeriodId mediaPeriodId, Timeline timeline)` | Creates track selections for the provided `Definitions`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Factory

          public Factory()

    - #### Factory

          public Factory​(int seed)

      Parameters:
        `seed` - A seed for the `Random` instance used by the factory.

  - ### Method Detail

    - #### createTrackSelections

          public @NullableType ExoTrackSelection[] createTrackSelections​(@NullableType ExoTrackSelection.Definition[] definitions,
                                                                         BandwidthMeter bandwidthMeter,
                                                                         MediaSource.MediaPeriodId mediaPeriodId,
                                                                         Timeline timeline)

      Description copied from interface: `ExoTrackSelection.Factory`
      Creates track selections for the provided `Definitions`.

      Implementations that create at most one adaptive track selection may use `TrackSelectionUtil.createTrackSelectionsForDefinitions(com.google.android.exoplayer2.trackselection.ExoTrackSelection.Definition[], com.google.android.exoplayer2.trackselection.TrackSelectionUtil.AdaptiveTrackSelectionFactory)`.

      Specified by:
        `createTrackSelections` in interface `ExoTrackSelection.Factory`
      Parameters:
        `definitions` - A `ExoTrackSelection.Definition` array. May include null values.
        `bandwidthMeter` - A `BandwidthMeter` which can be used to select tracks.
        `mediaPeriodId` - The `MediaSource.MediaPeriodId` of the period for which tracks are to be selected.
        `timeline` - The `Timeline` holding the period for which tracks are to be selected.
      Returns:
        The created selections. Must have the same length as `definitions` and may include null values.