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 forRandomTrackSelectioninstances.
-
-
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 providedDefinitions.
-
-
-
Constructor Detail
-
Factory
public Factory()
-
Factory
public Factory(int seed)
- Parameters:
seed- A seed for theRandominstance 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.FactoryCreates track selections for the providedDefinitions.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:
createTrackSelectionsin interfaceExoTrackSelection.Factory- Parameters:
definitions- AExoTrackSelection.Definitionarray. May include null values.bandwidthMeter- ABandwidthMeterwhich can be used to select tracks.mediaPeriodId- TheMediaSource.MediaPeriodIdof the period for which tracks are to be selected.timeline- TheTimelineholding the period for which tracks are to be selected.- Returns:
- The created selections. Must have the same length as
definitionsand may include null values.
-
-