docs/doc/reference/com/google/android/exoplayer2/trackselection/TrackSelectionParameters.html
Package com.google.android.exoplayer2.trackselection
All Implemented Interfaces:BundleableDirect Known Subclasses:DefaultTrackSelector.Parameters
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classTrackSelectionParametersextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](../Bundleable.html "interface in com.google.android.exoplayer2")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Parameters for controlling track selection.
Parameters can be queried and set on a Player. For example the following code modifies the parameters to restrict video track selections to SD, and to select a German audio track if there is one:
// Build on the current parameters.
TrackSelectionParameters currentParameters = player.getTrackSelectionParameters()
// Build the resulting parameters.
TrackSelectionParameters newParameters = currentParameters
.buildUpon()
.setMaxVideoSizeSd()
.setPreferredAudioLanguage("deu")
.build();
// Set the new parameters.
player.setTrackSelectionParameters(newParameters);
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | TrackSelectionParameters.Builder |
Deprecated.
A builder for TrackSelectionParameters.
|
-
Bundleable.Creator<T extends Bundleable>
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static Bundleable.Creator<TrackSelectionParameters> | CREATOR |
Deprecated.
Use fromBundle(Bundle) instead.
|
| static TrackSelectionParameters | DEFAULT |
Deprecated.
This instance is not configured using Context constraints.
|
| static TrackSelectionParameters | DEFAULT_WITHOUT_CONTEXT |
Deprecated.
An instance with default values, except those obtained from the Context.
|
| ImmutableSet<@TrackType Integer> | disabledTrackTypes |
Deprecated.
The track types that are disabled.
|
| protected static int | FIELD_CUSTOM_ID_BASE |
Deprecated.
Defines a minimum field ID value for subclasses to use when implementing toBundle() and Bundleable.Creator.
|
| boolean | forceHighestSupportedBitrate |
Deprecated.
Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints.
|
| boolean | forceLowestBitrate |
Deprecated.
Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints.
|
| @com.google.android.exoplayer2.C.SelectionFlags int | ignoredTextSelectionFlags |
Deprecated.
Bitmask of selection flags that are ignored for text track selections.
|
| int | maxAudioBitrate |
Deprecated.
Maximum allowed audio bitrate in bits per second.
|
| int | maxAudioChannelCount |
Deprecated.
Maximum allowed audio channel count.
|
| int | maxVideoBitrate |
Deprecated.
Maximum allowed video bitrate in bits per second.
|
| int | maxVideoFrameRate |
Deprecated.
Maximum allowed video frame rate in hertz.
|
| int | maxVideoHeight |
Deprecated.
Maximum allowed video height in pixels.
|
| int | maxVideoWidth |
Deprecated.
Maximum allowed video width in pixels.
|
| int | minVideoBitrate |
Deprecated.
Minimum allowed video bitrate in bits per second.
|
| int | minVideoFrameRate |
Deprecated.
Minimum allowed video frame rate in hertz.
|
| int | minVideoHeight |
Deprecated.
Minimum allowed video height in pixels.
|
| int | minVideoWidth |
Deprecated.
Minimum allowed video width in pixels.
|
| ImmutableMap<TrackGroup,TrackSelectionOverride> | overrides |
Deprecated.
Overrides to force selection of specific tracks.
|
| ImmutableList<String> | preferredAudioLanguages |
Deprecated.
The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference.
|
| ImmutableList<String> | preferredAudioMimeTypes |
Deprecated.
The preferred sample MIME types for audio tracks in order of preference, or an empty list for no preference.
|
| @com.google.android.exoplayer2.C.RoleFlags int | preferredAudioRoleFlags |
Deprecated.
The preferred C.RoleFlags for audio tracks.
|
| ImmutableList<String> | preferredTextLanguages |
Deprecated.
The preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference.
|
| @com.google.android.exoplayer2.C.RoleFlags int | preferredTextRoleFlags |
Deprecated.
The preferred C.RoleFlags for text tracks.
|
| ImmutableList<String> | preferredVideoMimeTypes |
Deprecated.
The preferred sample MIME types for video tracks in order of preference, or an empty list for no preference.
|
| @com.google.android.exoplayer2.C.RoleFlags int | preferredVideoRoleFlags |
Deprecated.
The preferred C.RoleFlags for video tracks.
|
| boolean | selectUndeterminedTextLanguage |
Deprecated.
Whether a text track with undetermined language should be selected if no track with preferredTextLanguages is available, or if preferredTextLanguages is unset.
|
| int | viewportHeight |
Deprecated.
Viewport height in pixels.
|
| boolean | viewportOrientationMayChange |
Deprecated.
Whether the viewport orientation may change during playback.
|
| int | viewportWidth |
Deprecated.
Viewport width in pixels. |
Constructors | Modifier | Constructor | Description |
| --- | --- | --- |
| protected | TrackSelectionParameters(TrackSelectionParameters.Builder builder) |
Deprecated.
|
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| TrackSelectionParameters.Builder | buildUpon() |
Deprecated.
Creates a new TrackSelectionParameters.Builder, copying the initial values from this instance.
|
| boolean | equals(Object obj) |
Deprecated.
|
| static TrackSelectionParameters | fromBundle(Bundle bundle) |
Deprecated.
Construct an instance from a Bundle produced by toBundle().
|
| static TrackSelectionParameters | getDefaults(Context context) |
Deprecated.
Returns an instance configured with default values.
|
| int | hashCode() |
Deprecated.
|
| Bundle | toBundle() |
Deprecated.
Returns a Bundle representing the information stored in this object.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
public static final[TrackSelectionParameters](TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")DEFAULT_WITHOUT_CONTEXT
Deprecated.
An instance with default values, except those obtained from the Context.
If possible, use getDefaults(Context) instead.
This instance will not have the following settings:
- [`Viewport
constraints`](TrackSelectionParameters.Builder.html#setViewportSizeToPhysicalDisplaySize(android.content.Context,boolean)) configured for the primary display.
- [`Preferred text language and role flags`](TrackSelectionParameters.Builder.html#setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(android.content.Context)) configured to the accessibility settings of [`CaptioningManager`](https://developer.android.com/reference/android/view/accessibility/CaptioningManager.html "class or interface in android.view.accessibility").
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static final[TrackSelectionParameters](TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")DEFAULT
Deprecated.
This instance is not configured using Context constraints. Use getDefaults(Context) instead.
-
public final int maxVideoWidth
Deprecated.
Maximum allowed video width in pixels. The default value is Integer.MAX_VALUE (i.e. no constraint).
To constrain adaptive video track selections to be suitable for a given viewport (the region of the display within which video will be played), use (viewportWidth, viewportHeight and viewportOrientationMayChange) instead.
-
public final int maxVideoHeight
Deprecated.
Maximum allowed video height in pixels. The default value is Integer.MAX_VALUE (i.e. no constraint).
To constrain adaptive video track selections to be suitable for a given viewport (the region of the display within which video will be played), use (viewportWidth, viewportHeight and viewportOrientationMayChange) instead.
-
public final int maxVideoFrameRate
Deprecated.
Maximum allowed video frame rate in hertz. The default value is Integer.MAX_VALUE (i.e. no constraint).
-
public final int maxVideoBitrate
Deprecated.
Maximum allowed video bitrate in bits per second. The default value is Integer.MAX_VALUE (i.e. no constraint).
-
public final int minVideoWidth
Deprecated.
Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint).
-
public final int minVideoHeight
Deprecated.
Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint).
-
public final int minVideoFrameRate
Deprecated.
Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint).
-
public final int minVideoBitrate
Deprecated.
Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint).
-
public final int viewportWidth
Deprecated.
Viewport width in pixels. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is the physical width of the primary display, in pixels.
-
public final int viewportHeight
Deprecated.
Viewport height in pixels. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is the physical height of the primary display, in pixels.
-
public final boolean viewportOrientationMayChange
Deprecated.
Whether the viewport orientation may change during playback. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is true.
-
public final[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")> preferredVideoMimeTypes
Deprecated.
The preferred sample MIME types for video tracks in order of preference, or an empty list for no preference. The default is an empty list.
-
[@RoleFlags](../C.RoleFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.RoleFlags int preferredVideoRoleFlags
Deprecated.
The preferred C.RoleFlags for video tracks. 0 selects the default track if there is one, or the first track if there's no default. The default value is 0.
-
public final[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")> preferredAudioLanguages
Deprecated.
The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference. An empty list selects the default track, or the first track if there's no default. The default value is an empty list.
-
[@RoleFlags](../C.RoleFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.RoleFlags int preferredAudioRoleFlags
Deprecated.
The preferred C.RoleFlags for audio tracks. 0 selects the default track if there is one, or the first track if there's no default. The default value is 0.
-
public final int maxAudioChannelCount
Deprecated.
Maximum allowed audio channel count. The default value is Integer.MAX_VALUE (i.e. no constraint).
-
public final int maxAudioBitrate
Deprecated.
Maximum allowed audio bitrate in bits per second. The default value is Integer.MAX_VALUE (i.e. no constraint).
-
public final[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")> preferredAudioMimeTypes
Deprecated.
The preferred sample MIME types for audio tracks in order of preference, or an empty list for no preference. The default is an empty list.
-
public final[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")> preferredTextLanguages
Deprecated.
The preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference. An empty list selects the default track if there is one, or no track otherwise. The default value is an empty list, or the language of the accessibility CaptioningManager if enabled.
-
[@RoleFlags](../C.RoleFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.RoleFlags int preferredTextRoleFlags
Deprecated.
The preferred C.RoleFlags for text tracks. 0 selects the default track if there is one, or no track otherwise. The default value is 0, or C.ROLE_FLAG_SUBTITLE | C.ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND if the accessibility CaptioningManager is enabled.
-
[@SelectionFlags](../C.SelectionFlags.html "annotation in com.google.android.exoplayer2")public final @com.google.android.exoplayer2.C.SelectionFlags int ignoredTextSelectionFlags
Deprecated.
Bitmask of selection flags that are ignored for text track selections. See C.SelectionFlags. The default value is 0 (i.e., no flags are ignored).
-
public final boolean selectUndeterminedTextLanguage
Deprecated.
Whether a text track with undetermined language should be selected if no track with preferredTextLanguages is available, or if preferredTextLanguages is unset. The default value is false.
-
public final boolean forceLowestBitrate
Deprecated.
Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints. The default value is false.
-
public final boolean forceHighestSupportedBitrate
Deprecated.
Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints. The default value is false.
-
public final[ImmutableMap](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableMap.html?is-external=true "class or interface in com.google.common.collect")<[TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source"),[TrackSelectionOverride](TrackSelectionOverride.html "class in com.google.android.exoplayer2.trackselection")> overrides
Deprecated.
Overrides to force selection of specific tracks.
-
public final[ImmutableSet](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableSet.html?is-external=true "class or interface in com.google.common.collect")<[@TrackType](../C.TrackType.html "annotation in com.google.android.exoplayer2")[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")> disabledTrackTypes
Deprecated.
The track types that are disabled. No track of a disabled type will be selected, thus no track type contained in the set will be played. The default value is that no track type is disabled (empty set).
-
protected static final int FIELD_CUSTOM_ID_BASE
Deprecated.
Defines a minimum field ID value for subclasses to use when implementing toBundle() and Bundleable.Creator.
Subclasses should obtain keys for their Bundle representation by applying a non-negative offset on this constant and passing the result to Util.intToStringMaxRadix(int).
See Also:Constant Field Values
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public static final[Bundleable.Creator](../Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[TrackSelectionParameters](TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")> CREATOR
Deprecated.
Use fromBundle(Bundle) instead.
-
protected TrackSelectionParameters([TrackSelectionParameters.Builder](TrackSelectionParameters.Builder.html "class in com.google.android.exoplayer2.trackselection")builder)
Deprecated.
-
public static[TrackSelectionParameters](TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")getDefaults([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)
Deprecated.
Returns an instance configured with default values.
-
public[TrackSelectionParameters.Builder](TrackSelectionParameters.Builder.html "class in com.google.android.exoplayer2.trackselection")buildUpon()
Deprecated.
Creates a new TrackSelectionParameters.Builder, copying the initial values from this instance.
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")obj)
Deprecated.
Overrides:equals in class Object
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()
Deprecated.
Description copied from interface: Bundleable
Returns a Bundle representing the information stored in this object.
Specified by:toBundle in interface Bundleable
-
public static[TrackSelectionParameters](TrackSelectionParameters.html "class in com.google.android.exoplayer2.trackselection")fromBundle([Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")bundle)
Deprecated.
Construct an instance from a Bundle produced by toBundle().