TrackSelectionUtil
@UnstableApi
public final class TrackSelectionUtil
Track selection related utility methods.
Summary
Nested types |
|---|
public interface TrackSelectionUtil.AdaptiveTrackSelectionFactoryFunctional interface to create a single adaptive track selection. |
Public methods |
|
|---|---|
static Tracks |
buildTracks(Returns |
static Tracks |
buildTracks(Returns |
static LoadErrorHandlingPolicy.FallbackOptions |
createFallbackOptions(ExoTrackSelection trackSelection)Returns the |
static ExoTrackSelection[] |
@NullableTypeCreates track selections for an array of track selection definitions, with at most one multi-track adaptive selection. |
static Point |
getMaxVideoSizeInViewport(Given viewport dimensions and video dimensions, computes the maximum size of the video as it will be rendered to fit inside of the viewport. |
static DefaultTrackSelector.Parameters |
This method is deprecated. Use |
Public methods
buildTracks
public static Tracks buildTracks(
MappingTrackSelector.MappedTrackInfo mappedTrackInfo,
@NullableType TrackSelection[] selections
)
Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.
| Parameters | |
|---|---|
MappingTrackSelector.MappedTrackInfo mappedTrackInfo |
|
@NullableType TrackSelection[] selections |
The track selections, indexed by renderer. A null entry indicates that a renderer does not have any selected tracks. |
buildTracks
public static Tracks buildTracks(
MappingTrackSelector.MappedTrackInfo mappedTrackInfo,
List[] selections
)
Returns Tracks built from MappingTrackSelector.MappedTrackInfo and TrackSelections for each renderer.
| Parameters | |
|---|---|
MappingTrackSelector.MappedTrackInfo mappedTrackInfo |
|
List[] selections |
The track selections, indexed by renderer. Null entries are not permitted. An empty list indicates that a renderer does not have any selected tracks. |
createFallbackOptions
public static LoadErrorHandlingPolicy.FallbackOptions createFallbackOptions(ExoTrackSelection trackSelection)
Returns the LoadErrorHandlingPolicy.FallbackOptions with the tracks of the given ExoTrackSelection and with a single location option indicating that there are no alternative locations available.
| Parameters | |
|---|---|
ExoTrackSelection trackSelection |
The track selection to get the number of total and excluded tracks. |
| Returns | |
|---|---|
LoadErrorHandlingPolicy.FallbackOptions |
The |
createTrackSelectionsForDefinitions
@NullableType
public static ExoTrackSelection[] createTrackSelectionsForDefinitions(
@NullableType ExoTrackSelection.Definition[] definitions,
TrackSelectionUtil.AdaptiveTrackSelectionFactory adaptiveTrackSelectionFactory
)
Creates track selections for an array of track selection definitions, with at most one multi-track adaptive selection.
| Parameters | |
|---|---|
@NullableType ExoTrackSelection.Definition[] definitions |
The list of track selection |
TrackSelectionUtil.AdaptiveTrackSelectionFactory adaptiveTrackSelectionFactory |
A factory for the multi-track adaptive track selection. |
| Returns | |
|---|---|
ExoTrackSelection[] |
The array of created track selection. For null entries in |
getMaxVideoSizeInViewport
public static Point getMaxVideoSizeInViewport(
boolean orientationMayChange,
int viewportWidth,
int viewportHeight,
int videoWidth,
int videoHeight
)
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
public static DefaultTrackSelector.ParametersupdateParametersWithOverride(
DefaultTrackSelector.Parameters parameters,
int rendererIndex,
TrackGroupArray trackGroupArray,
boolean isDisabled,
@Nullable DefaultTrackSelector.SelectionOverride override
)