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 forRandomTrackSelection
instances.
-
-
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 theRandom
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 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:
createTrackSelections
in interfaceExoTrackSelection.Factory
- Parameters:
definitions
- AExoTrackSelection.Definition
array. May include null values.bandwidthMeter
- ABandwidthMeter
which can be used to select tracks.mediaPeriodId
- TheMediaSource.MediaPeriodId
of the period for which tracks are to be selected.timeline
- TheTimeline
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.
-
-