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 classTrackSelectionParameters.BuilderA builder forTrackSelectionParameters.-
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>CREATORstatic TrackSelectionParametersDEFAULTDeprecated.This instance is not configured usingContextconstraints.static TrackSelectionParametersDEFAULT_WITHOUT_CONTEXTAn instance with default values, except those obtained from theContext.intdisabledTextTrackSelectionFlagsBitmask of selection flags that are disabled for text track selections.ImmutableList<String>preferredAudioLanguagesThe preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference.intpreferredAudioRoleFlagsThe preferredC.RoleFlagsfor audio tracks.ImmutableList<String>preferredTextLanguagesThe preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference.intpreferredTextRoleFlagsThe preferredC.RoleFlagsfor text tracks.booleanselectUndeterminedTextLanguageWhether a text track with undetermined language should be selected if no track withpreferredTextLanguagesis available, or ifpreferredTextLanguagesis 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.BuilderbuildUpon()Creates a newTrackSelectionParameters.Builder, copying the initial values from this instance.intdescribeContents()booleanequals(Object obj)static TrackSelectionParametersgetDefaults(Context context)Returns an instance configured with default values.inthashCode()voidwriteToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
DEFAULT_WITHOUT_CONTEXT
public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT
An instance with default values, except those obtained from theContext.If possible, use
getDefaults(Context)instead.This instance will not have the following settings:
Preferred text language and role flagsconfigured to the accessibility settings ofCaptioningManager.
-
DEFAULT
@Deprecated public static final TrackSelectionParameters DEFAULT
Deprecated.This instance is not configured usingContextconstraints. UsegetDefaults(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 preferredC.RoleFlagsfor audio tracks.0selects the default track if there is one, or the first track if there's no default. The default value is0.
-
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 accessibilityCaptioningManagerif enabled.
-
preferredTextRoleFlags
@RoleFlags public final int preferredTextRoleFlags
The preferredC.RoleFlagsfor text tracks.0selects the default track if there is one, or no track otherwise. The default value is0, orC.ROLE_FLAG_SUBTITLE|C.ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUNDif the accessibilityCaptioningManageris enabled.
-
selectUndeterminedTextLanguage
public final boolean selectUndeterminedTextLanguage
Whether a text track with undetermined language should be selected if no track withpreferredTextLanguagesis available, or ifpreferredTextLanguagesis unset. The default value isfalse.
-
disabledTextTrackSelectionFlags
@SelectionFlags public final int disabledTextTrackSelectionFlags
Bitmask of selection flags that are disabled for text track selections. SeeC.SelectionFlags. The default value is0(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 newTrackSelectionParameters.Builder, copying the initial values from this instance.
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
public void writeToParcel(Parcel dest, int flags)
- Specified by:
writeToParcelin interfaceParcelable
-
-