Class TrackSelectionParameters
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionParameters
-
- All Implemented Interfaces:
Bundleable
- Direct Known Subclasses:
DefaultTrackSelector.Parameters
@Deprecated public class TrackSelectionParameters extends Object implements Bundleable
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 Class Summary
Nested Classes Modifier and Type Class Description static classTrackSelectionParameters.BuilderDeprecated.A builder forTrackSelectionParameters.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<TrackSelectionParameters>CREATORDeprecated.UsefromBundle(Bundle)instead.static TrackSelectionParametersDEFAULTDeprecated.This instance is not configured usingContextconstraints.static TrackSelectionParametersDEFAULT_WITHOUT_CONTEXTDeprecated.An instance with default values, except those obtained from theContext.ImmutableSet<@TrackType Integer>disabledTrackTypesDeprecated.The track types that are disabled.protected static intFIELD_CUSTOM_ID_BASEDeprecated.Defines a minimum field ID value for subclasses to use when implementingtoBundle()andBundleable.Creator.booleanforceHighestSupportedBitrateDeprecated.Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints.booleanforceLowestBitrateDeprecated.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 intignoredTextSelectionFlagsDeprecated.Bitmask of selection flags that are ignored for text track selections.intmaxAudioBitrateDeprecated.Maximum allowed audio bitrate in bits per second.intmaxAudioChannelCountDeprecated.Maximum allowed audio channel count.intmaxVideoBitrateDeprecated.Maximum allowed video bitrate in bits per second.intmaxVideoFrameRateDeprecated.Maximum allowed video frame rate in hertz.intmaxVideoHeightDeprecated.Maximum allowed video height in pixels.intmaxVideoWidthDeprecated.Maximum allowed video width in pixels.intminVideoBitrateDeprecated.Minimum allowed video bitrate in bits per second.intminVideoFrameRateDeprecated.Minimum allowed video frame rate in hertz.intminVideoHeightDeprecated.Minimum allowed video height in pixels.intminVideoWidthDeprecated.Minimum allowed video width in pixels.ImmutableMap<TrackGroup,TrackSelectionOverride>overridesDeprecated.Overrides to force selection of specific tracks.ImmutableList<String>preferredAudioLanguagesDeprecated.The preferred languages for audio and forced text tracks as IETF BCP 47 conformant tags in order of preference.ImmutableList<String>preferredAudioMimeTypesDeprecated.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 intpreferredAudioRoleFlagsDeprecated.The preferredC.RoleFlagsfor audio tracks.ImmutableList<String>preferredTextLanguagesDeprecated.The preferred languages for text tracks as IETF BCP 47 conformant tags in order of preference.@com.google.android.exoplayer2.C.RoleFlags intpreferredTextRoleFlagsDeprecated.The preferredC.RoleFlagsfor text tracks.ImmutableList<String>preferredVideoMimeTypesDeprecated.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 intpreferredVideoRoleFlagsDeprecated.The preferredC.RoleFlagsfor video tracks.booleanselectUndeterminedTextLanguageDeprecated.Whether a text track with undetermined language should be selected if no track withpreferredTextLanguagesis available, or ifpreferredTextLanguagesis unset.intviewportHeightDeprecated.Viewport height in pixels.booleanviewportOrientationMayChangeDeprecated.Whether the viewport orientation may change during playback.intviewportWidthDeprecated.Viewport width in pixels.
-
Constructor Summary
Constructors Modifier Constructor Description protectedTrackSelectionParameters(TrackSelectionParameters.Builder builder)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TrackSelectionParameters.BuilderbuildUpon()Deprecated.Creates a newTrackSelectionParameters.Builder, copying the initial values from this instance.booleanequals(Object obj)Deprecated.static TrackSelectionParametersfromBundle(Bundle bundle)Deprecated.Construct an instance from aBundleproduced bytoBundle().static TrackSelectionParametersgetDefaults(Context context)Deprecated.Returns an instance configured with default values.inthashCode()Deprecated.BundletoBundle()Deprecated.Returns aBundlerepresenting the information stored in this object.
-
-
-
Field Detail
-
DEFAULT_WITHOUT_CONTEXT
public static final TrackSelectionParameters DEFAULT_WITHOUT_CONTEXT
Deprecated.An instance with default values, except those obtained from theContext.If possible, use
getDefaults(Context)instead.This instance will not have the following settings:
Viewport constraintsconfigured for the primary display.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.
-
maxVideoWidth
public final int maxVideoWidth
Deprecated.Maximum allowed video width in pixels. The default value isInteger.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,viewportHeightandviewportOrientationMayChange) instead.
-
maxVideoHeight
public final int maxVideoHeight
Deprecated.Maximum allowed video height in pixels. The default value isInteger.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,viewportHeightandviewportOrientationMayChange) instead.
-
maxVideoFrameRate
public final int maxVideoFrameRate
Deprecated.Maximum allowed video frame rate in hertz. The default value isInteger.MAX_VALUE(i.e. no constraint).
-
maxVideoBitrate
public final int maxVideoBitrate
Deprecated.Maximum allowed video bitrate in bits per second. The default value isInteger.MAX_VALUE(i.e. no constraint).
-
minVideoWidth
public final int minVideoWidth
Deprecated.Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint).
-
minVideoHeight
public final int minVideoHeight
Deprecated.Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint).
-
minVideoFrameRate
public final int minVideoFrameRate
Deprecated.Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint).
-
minVideoBitrate
public final int minVideoBitrate
Deprecated.Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint).
-
viewportWidth
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.
-
viewportHeight
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.
-
viewportOrientationMayChange
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 istrue.
-
preferredVideoMimeTypes
public final ImmutableList<String> 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.
-
preferredVideoRoleFlags
@RoleFlags public final @com.google.android.exoplayer2.C.RoleFlags int preferredVideoRoleFlags
Deprecated.The preferredC.RoleFlagsfor video tracks.0selects the default track if there is one, or the first track if there's no default. The default value is0.
-
preferredAudioLanguages
public final ImmutableList<String> 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.
-
preferredAudioRoleFlags
@RoleFlags public final @com.google.android.exoplayer2.C.RoleFlags int preferredAudioRoleFlags
Deprecated.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.
-
maxAudioChannelCount
public final int maxAudioChannelCount
Deprecated.Maximum allowed audio channel count. The default value isInteger.MAX_VALUE(i.e. no constraint).
-
maxAudioBitrate
public final int maxAudioBitrate
Deprecated.Maximum allowed audio bitrate in bits per second. The default value isInteger.MAX_VALUE(i.e. no constraint).
-
preferredAudioMimeTypes
public final ImmutableList<String> 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.
-
preferredTextLanguages
public final ImmutableList<String> 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 accessibilityCaptioningManagerif enabled.
-
preferredTextRoleFlags
@RoleFlags public final @com.google.android.exoplayer2.C.RoleFlags int preferredTextRoleFlags
Deprecated.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.
-
ignoredTextSelectionFlags
@SelectionFlags public final @com.google.android.exoplayer2.C.SelectionFlags int ignoredTextSelectionFlags
Deprecated.Bitmask of selection flags that are ignored for text track selections. SeeC.SelectionFlags. The default value is0(i.e., no flags are ignored).
-
selectUndeterminedTextLanguage
public final boolean selectUndeterminedTextLanguage
Deprecated.Whether a text track with undetermined language should be selected if no track withpreferredTextLanguagesis available, or ifpreferredTextLanguagesis unset. The default value isfalse.
-
forceLowestBitrate
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 isfalse.
-
forceHighestSupportedBitrate
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 isfalse.
-
overrides
public final ImmutableMap<TrackGroup,TrackSelectionOverride> overrides
Deprecated.Overrides to force selection of specific tracks.
-
disabledTrackTypes
public final ImmutableSet<@TrackType Integer> 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).
-
FIELD_CUSTOM_ID_BASE
protected static final int FIELD_CUSTOM_ID_BASE
Deprecated.Defines a minimum field ID value for subclasses to use when implementingtoBundle()andBundleable.Creator.Subclasses should obtain keys for their
Bundlerepresentation by applying a non-negative offset on this constant and passing the result toUtil.intToStringMaxRadix(int).- See Also:
- Constant Field Values
-
CREATOR
@Deprecated public static final Bundleable.Creator<TrackSelectionParameters> CREATOR
Deprecated.UsefromBundle(Bundle)instead.
-
-
Constructor Detail
-
TrackSelectionParameters
protected TrackSelectionParameters(TrackSelectionParameters.Builder builder)
Deprecated.
-
-
Method Detail
-
getDefaults
public static TrackSelectionParameters getDefaults(Context context)
Deprecated.Returns an instance configured with default values.
-
buildUpon
public TrackSelectionParameters.Builder buildUpon()
Deprecated.Creates a newTrackSelectionParameters.Builder, copying the initial values from this instance.
-
toBundle
public Bundle toBundle()
Deprecated.Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
fromBundle
public static TrackSelectionParameters fromBundle(Bundle bundle)
Deprecated.Construct an instance from aBundleproduced bytoBundle().
-
-