TrackSelectionUtil


@UnstableApi
class TrackSelectionUtil


Track selection related utility methods.

Summary

Nested types

Functional interface to create a single adaptive track selection.

Public functions

java-static Tracks!

Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.

java-static Tracks!
buildTracks(
    mappedTrackInfo: MappingTrackSelector.MappedTrackInfo!,
    selections: Array<(Mutable)List<TrackSelection!>!>!
)

Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.

java-static LoadErrorHandlingPolicy.FallbackOptions!

Returns the LoadErrorHandlingPolicy.FallbackOptions with the tracks of the given and with a single location option indicating that there are no alternative locations available.

java-static Array<@NullableType ExoTrackSelection!>!

Creates track selections for an array of track selection definitions, with at most one multi-track adaptive selection.

java-static Point!
getMaxVideoSizeInViewport(
    orientationMayChange: Boolean,
    viewportWidth: Int,
    viewportHeight: Int,
    videoWidth: Int,
    videoHeight: Int
)

Given viewport dimensions and video dimensions, computes the maximum size of the video as it will be rendered to fit inside of the viewport.

java-static DefaultTrackSelector.Parameters!
updateParametersWithOverride(
    parameters: DefaultTrackSelector.Parameters!,
    rendererIndex: Int,
    trackGroupArray: TrackGroupArray!,
    isDisabled: Boolean,
    override: DefaultTrackSelector.SelectionOverride?
)

This function is deprecated.

Use addOverride instead.

Public functions

buildTracks

java-static fun buildTracks(
    mappedTrackInfo: MappingTrackSelector.MappedTrackInfo!,
    @NullableType selections: Array<@NullableType TrackSelection!>!
): Tracks!

Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.

Parameters
mappedTrackInfo: MappingTrackSelector.MappedTrackInfo!

The MappingTrackSelector.MappedTrackInfo

@NullableType selections: Array<@NullableType TrackSelection!>!

The track selections, indexed by renderer. A null entry indicates that a renderer does not have any selected tracks.

Returns
Tracks!

The corresponding Tracks.

buildTracks

java-static fun buildTracks(
    mappedTrackInfo: MappingTrackSelector.MappedTrackInfo!,
    selections: Array<(Mutable)List<TrackSelection!>!>!
): Tracks!

Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.

Parameters
mappedTrackInfo: MappingTrackSelector.MappedTrackInfo!

The MappingTrackSelector.MappedTrackInfo

selections: Array<(Mutable)List<TrackSelection!>!>!

The track selections, indexed by renderer. Null entries are not permitted. An empty list indicates that a renderer does not have any selected tracks.

Returns
Tracks!

The corresponding Tracks.

createFallbackOptions

java-static fun createFallbackOptions(trackSelection: ExoTrackSelection!): LoadErrorHandlingPolicy.FallbackOptions!

Returns the LoadErrorHandlingPolicy.FallbackOptions with the tracks of the given and with a single location option indicating that there are no alternative locations available.

Parameters
trackSelection: ExoTrackSelection!

The track selection to get the number of total and excluded tracks.

createTrackSelectionsForDefinitions

@NullableType
java-static fun createTrackSelectionsForDefinitions(
    @NullableType definitions: Array<@NullableType ExoTrackSelection.Definition!>!,
    adaptiveTrackSelectionFactory: TrackSelectionUtil.AdaptiveTrackSelectionFactory!
): Array<@NullableType ExoTrackSelection!>!

Creates track selections for an array of track selection definitions, with at most one multi-track adaptive selection.

Parameters
@NullableType definitions: Array<@NullableType ExoTrackSelection.Definition!>!

The list of track selection definitions. May include null values.

adaptiveTrackSelectionFactory: TrackSelectionUtil.AdaptiveTrackSelectionFactory!

A factory for the multi-track adaptive track selection.

Returns
Array<@NullableType ExoTrackSelection!>!

The array of created track selection. For null entries in definitions returns null values.

getMaxVideoSizeInViewport

java-static fun getMaxVideoSizeInViewport(
    orientationMayChange: Boolean,
    viewportWidth: Int,
    viewportHeight: Int,
    videoWidth: Int,
    videoHeight: Int
): Point!

Given viewport dimensions and video dimensions, computes the maximum size of the video as it will be rendered to fit inside of the viewport.

updateParametersWithOverride

java-static fun updateParametersWithOverride(
    parameters: DefaultTrackSelector.Parameters!,
    rendererIndex: Int,
    trackGroupArray: TrackGroupArray!,
    isDisabled: Boolean,
    override: DefaultTrackSelector.SelectionOverride?
): DefaultTrackSelector.Parameters!