Package com.google.android.exoplayer2.trackselection

## Class TrackSelectionParameters

- java.lang.Object
- - com.google.android.exoplayer2.trackselection.TrackSelectionParameters

- All Implemented Interfaces:
    `Parcelable`
  Direct Known Subclasses:
    `DefaultTrackSelector.Parameters`

      public class TrackSelectionParameters
      extends Object
      implements Parcelable

  Constraint parameters for track selection.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `TrackSelectionParameters.Builder` | A builder for `TrackSelectionParameters`.

    - ### Nested classes/interfaces inherited from interface android.os.Parcelable

      `Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Parcelable.Creator<TrackSelectionParameters>` | `CREATOR` |
    `static TrackSelectionParameters` | `DEFAULT` | Deprecated. This instance is not configured using `Context` constraints.
    `static TrackSelectionParameters` | `DEFAULT_WITHOUT_CONTEXT` | An instance with default values, except those obtained from the `Context`.
    `int` | `disabledTextTrackSelectionFlags` | Bitmask of selection flags that are disabled for text track selections.
    `ImmutableList<String>` | `preferredAudioLanguages` | The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference.
    `int` | `preferredAudioRoleFlags` | The preferred `C.RoleFlags` for audio tracks.
    `ImmutableList<String>` | `preferredTextLanguages` | The preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference.
    `int` | `preferredTextRoleFlags` | The preferred `C.RoleFlags` for text tracks.
    `boolean` | `selectUndeterminedTextLanguage` | Whether a text track with undetermined language should be selected if no track with `preferredTextLanguages` is available, or if `preferredTextLanguages` is unset.

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `TrackSelectionParameters.Builder` | `buildUpon()` | Creates a new `TrackSelectionParameters.Builder`, copying the initial values from this instance.
    `int` | `describeContents()` |
    `boolean` | `equals​(Object obj)` |
    `static TrackSelectionParameters` | `getDefaults​(Context context)` | Returns an instance configured with default values.
    `int` | `hashCode()` |
    `void` | `writeToParcel​(Parcel dest, int flags)` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_WITHOUT_CONTEXT

          public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT

      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:

      - `Preferred text language and role flags` configured to the accessibility settings of `CaptioningManager`.

    - #### DEFAULT

          @Deprecated
          public static final TrackSelectionParameters DEFAULT

      Deprecated.
      This instance is not configured using `Context` constraints. Use `getDefaults(Context)` instead.

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

    - #### preferredAudioRoleFlags

          @RoleFlags
          public final int preferredAudioRoleFlags

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

    - #### 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, or the language of the accessibility `CaptioningManager` if enabled.

    - #### preferredTextRoleFlags

          @RoleFlags
          public final int preferredTextRoleFlags

      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.

    - #### selectUndeterminedTextLanguage

          public final boolean selectUndeterminedTextLanguage

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

    - #### disabledTextTrackSelectionFlags

          @SelectionFlags
          public final int disabledTextTrackSelectionFlags

      Bitmask of selection flags that are disabled for text track selections. See `C.SelectionFlags`. The default value is `0` (i.e. no flags).

    - #### CREATOR

          public static final Parcelable.Creator<TrackSelectionParameters> CREATOR

  - ### Method Detail

    - #### getDefaults

          public static TrackSelectionParameters getDefaults​(Context context)

      Returns an instance configured with default values.

    - #### buildUpon

          public TrackSelectionParameters.Builder buildUpon()

      Creates a new `TrackSelectionParameters.Builder`, copying the initial values from this instance.

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`