RandomTrackSelection.Factory


public final class RandomTrackSelection.Factory implements ExoTrackSelection.Factory


Factory for RandomTrackSelection instances.

Summary

Public constructors

Factory(int seed)

Public methods

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

Creates track selections for the provided Definitions.

Public constructors

Factory

public Factory()

Factory

public Factory(int seed)
Parameters
int seed

A seed for the Random instance used by the factory.

Public methods

createTrackSelections

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

Creates track selections for the provided Definitions.

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

Parameters
@NullableType ExoTrackSelection.Definition[] definitions

A Definition array. May include null values.

BandwidthMeter bandwidthMeter

A BandwidthMeter which can be used to select tracks.

MediaSource.MediaPeriodId 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
ExoTrackSelection[]

The created selections. Must have the same length as definitions and may include null values.