FakeTrackSelector.FakeTrackSelectionFactory


class FakeTrackSelector.FakeTrackSelectionFactory : ExoTrackSelection.Factory


A factory for the androidx.media3.test.utils.FakeTrackSelection instances requested by the FakeTrackSelector.

Summary

Public constructors

FakeTrackSelectionFactory(mayReuseTrackSelection: Boolean)

Public functions

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

Creates track selections for the provided Definitions.

Protected functions

ExoTrackSelection!

Creates the FakeTrackSelection from a TrackGroup.

Public constructors

FakeTrackSelectionFactory

FakeTrackSelectionFactory(mayReuseTrackSelection: Boolean)

Public functions

createTrackSelections

fun createTrackSelections(
    definitions: Array<@NullableType 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<@NullableType 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.

Protected functions

createTrackSelection

protected fun createTrackSelection(trackGroup: TrackGroup!): ExoTrackSelection!

Creates the FakeTrackSelection from a TrackGroup.