# TrackSelectionParameters

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/TrackSelectionParameters.java+class:androidx.media3.common.TrackSelectionParameters)

*** ** * ** ***

<br />

```
public class TrackSelectionParameters
```

<br />

Known direct subclasses [DefaultTrackSelector.Parameters](https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.Parameters)

|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.Parameters` | Extends `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector.Parameters` by adding fields that are specific to `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/DefaultTrackSelector`. |

*** ** * ** ***

Parameters for controlling track selection.

Parameters can be queried and set on a `https://developer.android.com/reference/androidx/media3/common/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("de")
    .build();
// Set the new parameters.
player.setTrackSelectionParameters(newParameters);
```

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi public final class https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences` Preferences and constraints for enabling audio offload. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.AudioOffloadMode` The preference level for enabling audio offload on the audio sink. |
| `public final class https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences.Builder` A builder for `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences`. |
| `public class https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder` A builder for `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters`. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT()` An instance with default parameters. |
| `static final https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT_WITHOUT_CONTEXT()` **This field is deprecated.** Use `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT()` instead. <br /> |
| `static final int` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#FIELD_CUSTOM_ID_BASE() = 1000` Defines a minimum field ID value for subclasses to use when implementing `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#toBundle()` and delegating to `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder#Builder(android.os.Bundle)`. |

| ### Public fields |
|---|---|
| `final https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#audioOffloadPreferences()` The preferred offload mode settings for audio playback. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<@https://developer.android.com/reference/androidx/media3/common/C.TrackType https://developer.android.com/reference/java/lang/Integer.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#disabledTrackTypes()` The track types that are disabled. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#forceHighestSupportedBitrate()` Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#forceLowestBitrate()` Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/C.SelectionFlags https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#ignoredTextSelectionFlags()` Bitmask of selection flags that are ignored for text track selections. |
| `final boolean` | `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#isPrioritizeImageOverVideoEnabled()` Whether an image track will be selected over a video track if both are available. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#isViewportSizeLimitedByPhysicalDisplaySize()` Whether the viewport size should be assumed to the physical display size if no other specific viewport size constraint is specified. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxAudioBitrate()` Maximum allowed audio bitrate in bits per second. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxAudioChannelCount()` Maximum allowed audio channel count. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxVideoBitrate()` Maximum allowed video bitrate in bits per second. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxVideoFrameRate()` Maximum allowed video frame rate in hertz. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxVideoHeight()` Maximum allowed video height in pixels. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#maxVideoWidth()` Maximum allowed video width in pixels. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#minVideoBitrate()` Minimum allowed video bitrate in bits per second. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#minVideoFrameRate()` Minimum allowed video frame rate in hertz. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#minVideoHeight()` Minimum allowed video height in pixels. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#minVideoWidth()` Minimum allowed video width in pixels. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup, https://developer.android.com/reference/androidx/media3/common/TrackSelectionOverride>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#overrides()` Overrides to force selection of specific tracks. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredAudioLabels()` The preferred labels for audio tracks in order of preference, or an empty list for no preference. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredAudioLanguages()` The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredAudioMimeTypes()` The preferred sample MIME types for audio tracks in order of preference, or an empty list for no preference. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/C.RoleFlags https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredAudioRoleFlags()` The preferred `https://developer.android.com/reference/androidx/media3/common/C.RoleFlags` for audio tracks. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLabels()` The preferred labels for text tracks in order of preference, or an empty list for no preference. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLanguages()` The preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/C.RoleFlags https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextRoleFlags()` The preferred `https://developer.android.com/reference/androidx/media3/common/C.RoleFlags` for text tracks. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredVideoLabels()` The preferred labels for video tracks in order of preference, or an empty list for no preference. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredVideoLanguages()` The preferred languages for video tracks as IETF BCP 47 conformant tags in order of preference. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredVideoMimeTypes()` The preferred sample MIME types for video tracks in order of preference, or an empty list for no preference. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/common/C.RoleFlags https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredVideoRoleFlags()` The preferred `https://developer.android.com/reference/androidx/media3/common/C.RoleFlags` for video tracks. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#selectTextByDefault()` Prefer to select any text track by default. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#selectUndeterminedTextLanguage()` Whether a text track with undetermined language should be selected if no track with `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLanguages()` is available, or if `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLanguages()` is unset. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#usePreferredTextLanguagesAndRoleFlagsFromCaptioningManager()` Whether the preferred languages and the preferred role flags for text tracks should be set according the `https://developer.android.com/reference/android/view/accessibility/CaptioningManager.html` preferences, if enabled in the system settings and no other explicit language or role flag preferences are specified. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportHeight()` Viewport height in pixels. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportOrientationMayChange()` Whether the viewport orientation may change during playback. |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportWidth()` Viewport width in pixels. |

| ### Protected constructors |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#TrackSelectionParameters(androidx.media3.common.TrackSelectionParameters.Builder)(https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder builder)` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#buildUpon()()` Creates a new `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder`, copying the initial values from this instance. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#fromBundle(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle.html bundle)` Construct an instance from a `https://developer.android.com/reference/android/os/Bundle.html` produced by `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#toBundle()`. |
| `static https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters` | `[getDefaults](https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#getDefaults(android.content.Context))(https://developer.android.com/reference/android/content/Context.html context)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT()` instead. <br /> |
| `int` | `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#hashCode()()` |
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/androidx/annotation/CallSuper https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#toBundle()()` |

## Constants

### DEFAULT

```
@UnstableApi
public static final TrackSelectionParameters DEFAULT
```

An instance with default parameters.

### DEFAULT_WITHOUT_CONTEXT

```
@UnstableApi
public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT
```

> [!CAUTION]
> **This field is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT()` instead.

### FIELD_CUSTOM_ID_BASE

```
@UnstableApi
protected static final int FIELD_CUSTOM_ID_BASE = 1000
```

Defines a minimum field ID value for subclasses to use when implementing `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#toBundle()` and delegating to `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder#Builder(android.os.Bundle)`.

Subclasses should obtain keys for their `https://developer.android.com/reference/android/os/Bundle.html` representation by applying a non-negative offset on this constant and passing the result to `https://developer.android.com/reference/androidx/media3/common/util/Util#intToStringMaxRadix(int)`.

## Public fields

### audioOffloadPreferences

```
@UnstableApi
public final TrackSelectionParameters.AudioOffloadPreferences audioOffloadPreferences
```

The preferred offload mode settings for audio playback. The default is `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.AudioOffloadPreferences#DEFAULT()`.

### disabledTrackTypes

```
public final ImmutableSet<@C.TrackType Integer> disabledTrackTypes
```

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).

### forceHighestSupportedBitrate

```
public final boolean forceHighestSupportedBitrate
```

Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints. The default value is `false`.

### forceLowestBitrate

```
public final boolean forceLowestBitrate
```

Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints. The default value is `false`.

### ignoredTextSelectionFlags

```
@C.SelectionFlags
public final int ignoredTextSelectionFlags
```

Bitmask of selection flags that are ignored for text track selections. See `https://developer.android.com/reference/androidx/media3/common/C.SelectionFlags`. The default value is `0` (i.e., no flags are ignored).

### isPrioritizeImageOverVideoEnabled

```
@UnstableApi
public final boolean isPrioritizeImageOverVideoEnabled
```

Whether an image track will be selected over a video track if both are available. The default value is `false`.

### isViewportSizeLimitedByPhysicalDisplaySize

```
public final boolean isViewportSizeLimitedByPhysicalDisplaySize
```

Whether the viewport size should be assumed to the physical display size if no other specific viewport size constraint is specified. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is `true`.

### maxAudioBitrate

```
public final int maxAudioBitrate
```

Maximum allowed audio bitrate in bits per second. The default value is `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE` (i.e. no constraint).

### maxAudioChannelCount

```
public final int maxAudioChannelCount
```

Maximum allowed audio channel count. The default value is `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE` (i.e. no constraint).

### maxVideoBitrate

```
public final int maxVideoBitrate
```

Maximum allowed video bitrate in bits per second. The default value is `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE` (i.e. no constraint).

### maxVideoFrameRate

```
public final int maxVideoFrameRate
```

Maximum allowed video frame rate in hertz. The default value is `https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE` (i.e. no constraint).

### maxVideoHeight

```
public final int maxVideoHeight
```

Maximum allowed video height in pixels. The default value is `https://developer.android.com/reference/java/lang/Integer.html#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 (`https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportWidth()`, `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportHeight()` and `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportOrientationMayChange()`) instead.

### maxVideoWidth

```
public final int maxVideoWidth
```

Maximum allowed video width in pixels. The default value is `https://developer.android.com/reference/java/lang/Integer.html#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 (`https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportWidth()`, `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportHeight()` and `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#viewportOrientationMayChange()`) instead.

### minVideoBitrate

```
public final int minVideoBitrate
```

Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint).

### minVideoFrameRate

```
public final int minVideoFrameRate
```

Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint).

### minVideoHeight

```
public final int minVideoHeight
```

Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint).

### minVideoWidth

```
public final int minVideoWidth
```

Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint).

### overrides

```
public final ImmutableMap<TrackGroup, TrackSelectionOverride> overrides
```

Overrides to force selection of specific tracks.

### preferredAudioLabels

```
public final ImmutableList<String> preferredAudioLabels
```

The preferred labels for audio tracks in order of preference, or an empty list for no preference. The default is an empty list.

### preferredAudioLanguages

```
public final ImmutableList<String> preferredAudioLanguages
```

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.

### preferredAudioMimeTypes

```
public final ImmutableList<String> preferredAudioMimeTypes
```

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.

### preferredAudioRoleFlags

```
@C.RoleFlags
public final int preferredAudioRoleFlags
```

The preferred `https://developer.android.com/reference/androidx/media3/common/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`.

### preferredTextLabels

```
public final ImmutableList<String> preferredTextLabels
```

The preferred labels for text tracks in order of preference, or an empty list for no preference. The default is an empty list.

### preferredTextLanguages

```
public final ImmutableList<String> preferredTextLanguages
```

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.

### preferredTextRoleFlags

```
@C.RoleFlags
public final int preferredTextRoleFlags
```

The preferred `https://developer.android.com/reference/androidx/media3/common/C.RoleFlags` for text tracks. `0` selects the default track if there is one, or no track otherwise. The default value is `0`.

### preferredVideoLabels

```
public final ImmutableList<String> preferredVideoLabels
```

The preferred labels for video tracks in order of preference, or an empty list for no preference. The default is an empty list.

### preferredVideoLanguages

```
public final ImmutableList<String> preferredVideoLanguages
```

The preferred languages for video tracks as IETF BCP 47 conformant tags in order of preference.

### preferredVideoMimeTypes

```
public final ImmutableList<String> preferredVideoMimeTypes
```

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.

### preferredVideoRoleFlags

```
@C.RoleFlags
public final int preferredVideoRoleFlags
```

The preferred `https://developer.android.com/reference/androidx/media3/common/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`.

### selectTextByDefault

```
public final boolean selectTextByDefault
```

Prefer to select any text track by default.

If `false`, text tracks are only selected if they match any of the other preference settings.

The default value is `false`.

### selectUndeterminedTextLanguage

```
public final boolean selectUndeterminedTextLanguage
```

Whether a text track with undetermined language should be selected if no track with `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLanguages()` is available, or if `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#preferredTextLanguages()` is unset. The default value is `false`.

### usePreferredTextLanguagesAndRoleFlagsFromCaptioningManager

```
public final boolean usePreferredTextLanguagesAndRoleFlagsFromCaptioningManager
```

Whether the preferred languages and the preferred role flags for text tracks should be set according the `https://developer.android.com/reference/android/view/accessibility/CaptioningManager.html` preferences, if enabled in the system settings and no other explicit language or role flag preferences are specified. The default value is ` true`.

### viewportHeight

```
public final int viewportHeight
```

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.

### viewportOrientationMayChange

```
public final boolean viewportOrientationMayChange
```

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`.

### viewportWidth

```
public final int viewportWidth
```

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.

## Protected constructors

### TrackSelectionParameters

```
@UnstableApi
protected TrackSelectionParameters(TrackSelectionParameters.Builder builder)
```

## Public methods

### buildUpon

```
public TrackSelectionParameters.Builder buildUpon()
```

Creates a new `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters.Builder`, copying the initial values from this instance.

### equals

```
public boolean equals(@Nullable Object obj)
```

### fromBundle

```
public static TrackSelectionParameters fromBundle(Bundle bundle)
```

Construct an instance from a `https://developer.android.com/reference/android/os/Bundle.html` produced by `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#toBundle()`.

### getDefaults

```
public static TrackSelectionParameters [getDefaults](https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#getDefaults(android.content.Context))(Context context)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters#DEFAULT()` instead.

### hashCode

```
public int hashCode()
```

### toBundle

```
@CallSuper
public Bundle toBundle()
```