public final class

DefaultTrackSelector.Parameters

extends TrackSelectionParameters

 java.lang.Object

androidx.media3.common.TrackSelectionParameters

↳androidx.media3.exoplayer.trackselection.DefaultTrackSelector.Parameters

Overview

Extends DefaultTrackSelector.Parameters by adding fields that are specific to DefaultTrackSelector.

Summary

Fields
public final booleanallowAudioMixedChannelCountAdaptiveness

Whether to allow adaptive audio selections containing mixed channel counts.

public final booleanallowAudioMixedDecoderSupportAdaptiveness

Whether to allow adaptive audio selections with mixed levels of and .

public final booleanallowAudioMixedMimeTypeAdaptiveness

Whether to allow adaptive audio selections containing mixed MIME types.

public final booleanallowAudioMixedSampleRateAdaptiveness

Whether to allow adaptive audio selections containing mixed sample rates.

public final booleanallowAudioNonSeamlessAdaptiveness

Whether to allow adaptive audio selections where adaptation may not be completely seamless.

public final booleanallowInvalidateSelectionsOnRendererCapabilitiesChange

Whether to allow to invalidate selections on renderer capabilities change.

public final booleanallowMultipleAdaptiveSelections

Whether multiple adaptive selections with more than one track are allowed.

public final booleanallowVideoMixedDecoderSupportAdaptiveness

Whether to allow adaptive video selections with mixed levels of and .

public final booleanallowVideoMixedMimeTypeAdaptiveness

Whether to allow adaptive video selections containing mixed MIME types.

public final booleanallowVideoNonSeamlessAdaptiveness

Whether to allow adaptive video selections where adaptation may not be completely seamless.

public final booleanconstrainAudioChannelCountToDeviceCapabilities

Whether to constrain audio track selection so that the selected track's channel count does not exceed the device's output capabilities.

public static final DefaultTrackSelector.ParametersDEFAULT

public static final DefaultTrackSelector.ParametersDEFAULT_WITHOUT_CONTEXT

An instance with default values, except those obtained from the .

public final booleanexceedAudioConstraintsIfNecessary

Whether to exceed the TrackSelectionParameters.maxAudioChannelCount and TrackSelectionParameters.maxAudioBitrate constraints when no selection can be made otherwise.

public final booleanexceedRendererCapabilitiesIfNecessary

Whether to exceed renderer capabilities when no selection can be made otherwise.

public final booleanexceedVideoConstraintsIfNecessary

Whether to exceed the TrackSelectionParameters.maxVideoWidth, TrackSelectionParameters.maxVideoHeight and TrackSelectionParameters.maxVideoBitrate constraints when no selection can be made otherwise.

public final booleantunnelingEnabled

Whether to enable tunneling if possible.

from TrackSelectionParametersaudioOffloadPreferences, disabledTrackTypes, FIELD_CUSTOM_ID_BASE, forceHighestSupportedBitrate, forceLowestBitrate, ignoredTextSelectionFlags, isPrioritizeImageOverVideoEnabled, maxAudioBitrate, maxAudioChannelCount, maxVideoBitrate, maxVideoFrameRate, maxVideoHeight, maxVideoWidth, minVideoBitrate, minVideoFrameRate, minVideoHeight, minVideoWidth, overrides, preferredAudioLanguages, preferredAudioMimeTypes, preferredAudioRoleFlags, preferredTextLanguages, preferredTextRoleFlags, preferredVideoMimeTypes, preferredVideoRoleFlags, selectUndeterminedTextLanguage, viewportHeight, viewportOrientationMayChange, viewportWidth
Methods
public DefaultTrackSelector.Parameters.BuilderbuildUpon()

Creates a new DefaultTrackSelector.Parameters.Builder, copying the initial values from this instance.

public booleanequals(java.lang.Object obj)

public static DefaultTrackSelector.ParametersfromBundle(Bundle bundle)

Restores a Parameters from a .

public static DefaultTrackSelector.ParametersgetDefaults(Context context)

Returns an instance configured with default values.

public booleangetRendererDisabled(int rendererIndex)

Returns whether the renderer is disabled.

public DefaultTrackSelector.SelectionOverridegetSelectionOverride(int rendererIndex, TrackGroupArray groups)

Returns the override for the specified renderer and TrackGroupArray.

public inthashCode()

public booleanhasSelectionOverride(int rendererIndex, TrackGroupArray groups)

Returns whether there is an override for the specified renderer and TrackGroupArray.

public BundletoBundle()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public static final DefaultTrackSelector.Parameters DEFAULT_WITHOUT_CONTEXT

An instance with default values, except those obtained from the .

If possible, use DefaultTrackSelector.Parameters.getDefaults(Context) instead.

This instance will not have the following settings:

public static final DefaultTrackSelector.Parameters DEFAULT

Deprecated: This instance is not configured using constraints. Use DefaultTrackSelector.Parameters.getDefaults(Context) instead.

public final boolean exceedVideoConstraintsIfNecessary

Whether to exceed the TrackSelectionParameters.maxVideoWidth, TrackSelectionParameters.maxVideoHeight and TrackSelectionParameters.maxVideoBitrate constraints when no selection can be made otherwise. The default value is true.

public final boolean allowVideoMixedMimeTypeAdaptiveness

Whether to allow adaptive video selections containing mixed MIME types. Adaptations between different MIME types may not be completely seamless, in which case DefaultTrackSelector.Parameters.allowVideoNonSeamlessAdaptiveness also needs to be true for mixed MIME type selections to be made. The default value is false.

public final boolean allowVideoNonSeamlessAdaptiveness

Whether to allow adaptive video selections where adaptation may not be completely seamless. The default value is true.

public final boolean allowVideoMixedDecoderSupportAdaptiveness

Whether to allow adaptive video selections with mixed levels of and .

public final boolean exceedAudioConstraintsIfNecessary

Whether to exceed the TrackSelectionParameters.maxAudioChannelCount and TrackSelectionParameters.maxAudioBitrate constraints when no selection can be made otherwise. The default value is true.

public final boolean allowAudioMixedMimeTypeAdaptiveness

Whether to allow adaptive audio selections containing mixed MIME types. Adaptations between different MIME types may not be completely seamless, in which case DefaultTrackSelector.Parameters.allowAudioNonSeamlessAdaptiveness also needs to be true for mixed MIME type selections to be made. The default value is false.

public final boolean allowAudioMixedSampleRateAdaptiveness

Whether to allow adaptive audio selections containing mixed sample rates. Adaptations between different sample rates may not be completely seamless. The default value is false.

public final boolean allowAudioMixedChannelCountAdaptiveness

Whether to allow adaptive audio selections containing mixed channel counts. Adaptations between different channel counts may not be completely seamless. The default value is false.

public final boolean allowAudioMixedDecoderSupportAdaptiveness

Whether to allow adaptive audio selections with mixed levels of and .

public final boolean allowAudioNonSeamlessAdaptiveness

Whether to allow adaptive audio selections where adaptation may not be completely seamless. The default value is true.

public final boolean constrainAudioChannelCountToDeviceCapabilities

Whether to constrain audio track selection so that the selected track's channel count does not exceed the device's output capabilities. The default value is true.

public final boolean exceedRendererCapabilitiesIfNecessary

Whether to exceed renderer capabilities when no selection can be made otherwise.

This parameter applies when all of the tracks available for a renderer exceed the renderer's reported capabilities. If the parameter is true then the lowest quality track will still be selected. Playback may succeed if the renderer has under-reported its true capabilities. If false then no track will be selected. The default value is true.

public final boolean tunnelingEnabled

Whether to enable tunneling if possible.

public final boolean allowMultipleAdaptiveSelections

Whether multiple adaptive selections with more than one track are allowed. The default value is true.

Note that tracks are only eligible for adaptation if they define a bitrate, the renderers support the tracks and allow adaptation between them, and they are not excluded based on other track selection parameters.

public final boolean allowInvalidateSelectionsOnRendererCapabilitiesChange

Whether to allow to invalidate selections on renderer capabilities change. The default value is false.

Methods

public static DefaultTrackSelector.Parameters getDefaults(Context context)

Returns an instance configured with default values.

public boolean getRendererDisabled(int rendererIndex)

Returns whether the renderer is disabled.

Parameters:

rendererIndex: The renderer index.

Returns:

Whether the renderer is disabled.

public boolean hasSelectionOverride(int rendererIndex, TrackGroupArray groups)

Deprecated: Only works to retrieve the overrides set with the deprecated DefaultTrackSelector.Parameters.Builder. Use TrackSelectionParameters.overrides instead.

Returns whether there is an override for the specified renderer and TrackGroupArray.

Parameters:

rendererIndex: The renderer index.
groups: The TrackGroupArray.

Returns:

Whether there is an override.

public DefaultTrackSelector.SelectionOverride getSelectionOverride(int rendererIndex, TrackGroupArray groups)

Deprecated: Only works to retrieve the overrides set with the deprecated DefaultTrackSelector.Parameters.Builder. Use TrackSelectionParameters.overrides instead.

Returns the override for the specified renderer and TrackGroupArray.

Parameters:

rendererIndex: The renderer index.
groups: The TrackGroupArray.

Returns:

The override, or null if no override exists.

Creates a new DefaultTrackSelector.Parameters.Builder, copying the initial values from this instance.

public boolean equals(java.lang.Object obj)

public int hashCode()

public Bundle toBundle()

public static DefaultTrackSelector.Parameters fromBundle(Bundle bundle)

Restores a Parameters from a .