DefaultTrackSelector.ParametersBuilder

class DefaultTrackSelector.ParametersBuilder : TrackSelectionParameters.Builder


Summary

Public constructors

This function is deprecated.

Context constraints will not be set using this constructor.

Creates a builder with default initial values.

Public functions

DefaultTrackSelector.ParametersBuilder!

Adds an override, replacing any override for the same TrackGroup.

DefaultTrackSelector.Parameters!

Builds a Parameters instance with the selected values.

DefaultTrackSelector.ParametersBuilder!

Removes the override for the provided media TrackGroup, if there is one.

DefaultTrackSelector.ParametersBuilder!

Removes all overrides.

DefaultTrackSelector.ParametersBuilder!

Removes all overrides of the provided track type.

DefaultTrackSelector.ParametersBuilder!

This function is deprecated.

Use clearOverride.

DefaultTrackSelector.ParametersBuilder!

This function is deprecated.

Use clearOverrides.

DefaultTrackSelector.ParametersBuilder!

This function is deprecated.

Use clearOverridesOfType.

DefaultTrackSelector.ParametersBuilder!

Equivalent to setMaxVideoSize(Integer.MAX_VALUE, Integer.MAX_VALUE).

DefaultTrackSelector.ParametersBuilder!

Equivalent to setViewportSize(Integer.MAX_VALUE, Integer.MAX_VALUE, true).

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowAudioMixedChannelCountAdaptiveness(
    allowAudioMixedChannelCountAdaptiveness: Boolean
)

Sets whether to allow adaptive audio selections containing mixed channel counts.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowAudioMixedDecoderSupportAdaptiveness(
    allowAudioMixedDecoderSupportAdaptiveness: Boolean
)

Sets whether to allow adaptive audio selections with mixed levels of and .

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowAudioMixedMimeTypeAdaptiveness(
    allowAudioMixedMimeTypeAdaptiveness: Boolean
)

Sets whether to allow adaptive audio selections containing mixed MIME types.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowAudioMixedSampleRateAdaptiveness(
    allowAudioMixedSampleRateAdaptiveness: Boolean
)

Sets whether to allow adaptive audio selections containing mixed sample rates.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowMultipleAdaptiveSelections(
    allowMultipleAdaptiveSelections: Boolean
)

Sets whether multiple adaptive selections with more than one track are allowed.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowVideoMixedDecoderSupportAdaptiveness(
    allowVideoMixedDecoderSupportAdaptiveness: Boolean
)

Sets whether to allow adaptive video selections with mixed levels of and .

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowVideoMixedMimeTypeAdaptiveness(
    allowVideoMixedMimeTypeAdaptiveness: Boolean
)

Sets whether to allow adaptive video selections containing mixed MIME types.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setAllowVideoNonSeamlessAdaptiveness(
    allowVideoNonSeamlessAdaptiveness: Boolean
)

Sets whether to allow adaptive video selections where adaptation may not be completely seamless.

DefaultTrackSelector.ParametersBuilder!

Sets the audio offload mode preferences.

DefaultTrackSelector.ParametersBuilder!

This function is deprecated.

Use setIgnoredTextSelectionFlags.

DefaultTrackSelector.ParametersBuilder!

This function is deprecated.

Use setTrackTypeDisabled.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setExceedAudioConstraintsIfNecessary(
    exceedAudioConstraintsIfNecessary: Boolean
)

Sets whether to exceed the setMaxAudioChannelCount and setMaxAudioBitrate constraints when no selection can be made otherwise.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setExceedRendererCapabilitiesIfNecessary(
    exceedRendererCapabilitiesIfNecessary: Boolean
)

Sets whether to exceed renderer capabilities when no selection can be made otherwise.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setExceedVideoConstraintsIfNecessary(
    exceedVideoConstraintsIfNecessary: Boolean
)

Sets whether to exceed the setMaxVideoBitrate, setMaxVideoSize and setMaxVideoFrameRate constraints when no selection can be made otherwise.

DefaultTrackSelector.ParametersBuilder!

Sets whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints.

DefaultTrackSelector.ParametersBuilder!

Sets whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints.

DefaultTrackSelector.ParametersBuilder!

Sets a bitmask of selection flags that are ignored for text track selections.

DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed audio bitrate.

DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed audio channel count.

DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed video bitrate.

DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed video frame rate.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setMaxVideoSize(maxVideoWidth: Int, maxVideoHeight: Int)

Sets the maximum allowed video width and height.

DefaultTrackSelector.ParametersBuilder!

Equivalent to setMaxVideoSize(1279, 719).

DefaultTrackSelector.ParametersBuilder!

Sets the minimum allowed video bitrate.

DefaultTrackSelector.ParametersBuilder!

Sets the minimum allowed video frame rate.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setMinVideoSize(minVideoWidth: Int, minVideoHeight: Int)

Sets the minimum allowed video width and height.

DefaultTrackSelector.ParametersBuilder!

Sets an override, replacing all existing overrides with the same track type.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred language for audio and forced text tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred languages for audio and forced text tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME type for audio tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME types for audio tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for audio tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred language for text tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred language and role flags for text tracks based on the accessibility settings of CaptioningManager.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred languages for text tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for text tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME type for video tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME types for video tracks.

DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for video tracks.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setPrioritizeImageOverVideoEnabled(
    isPrioritizeImageOverVideoEnabled: Boolean
)

Sets whether an image track would be selected over a video track if both are available.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setRendererDisabled(rendererIndex: Int, disabled: Boolean)

Sets whether the renderer at the specified index is disabled.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setSelectUndeterminedTextLanguage(
    selectUndeterminedTextLanguage: Boolean
)

Sets whether a text track with undetermined language should be selected if no track with a preferred language is available, or if the preferred language is unset.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setSelectionOverride(
    rendererIndex: Int,
    groups: TrackGroupArray!,
    override: DefaultTrackSelector.SelectionOverride?
)

This function is deprecated.

Use addOverride.

DefaultTrackSelector.ParametersBuilder!

Sets whether a track type is disabled.

DefaultTrackSelector.ParametersBuilder!

Sets whether to enable tunneling if possible.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setViewportSize(
    viewportWidth: Int,
    viewportHeight: Int,
    viewportOrientationMayChange: Boolean
)

Sets the viewport size to constrain adaptive video selections so that only tracks suitable for the viewport are selected.

DefaultTrackSelector.ParametersBuilder!
@CanIgnoreReturnValue
setViewportSizeToPhysicalDisplaySize(
    context: Context!,
    viewportOrientationMayChange: Boolean
)

Equivalent to calling setViewportSize with the viewport size obtained from getCurrentDisplayModeSize.

Protected functions

DefaultTrackSelector.ParametersBuilder!

Overrides the value of the builder with the value of TrackSelectionParameters.

Public constructors

ParametersBuilder

ParametersBuilder()

ParametersBuilder

ParametersBuilder(context: Context!)

Creates a builder with default initial values.

Parameters
context: Context!

Any context.

Public functions

addOverride

@CanIgnoreReturnValue
fun addOverride(override: TrackSelectionOverride!): DefaultTrackSelector.ParametersBuilder!

Adds an override, replacing any override for the same TrackGroup.

build

fun build(): DefaultTrackSelector.Parameters!

Builds a Parameters instance with the selected values.

clearOverride

@CanIgnoreReturnValue
fun clearOverride(trackGroup: TrackGroup!): DefaultTrackSelector.ParametersBuilder!

Removes the override for the provided media TrackGroup, if there is one.

clearOverrides

@CanIgnoreReturnValue
fun clearOverrides(): DefaultTrackSelector.ParametersBuilder!

Removes all overrides.

clearOverridesOfType

@CanIgnoreReturnValue
fun clearOverridesOfType(@C.TrackType trackType: Int): DefaultTrackSelector.ParametersBuilder!

Removes all overrides of the provided track type.

clearSelectionOverride

@CanIgnoreReturnValue
fun clearSelectionOverride(rendererIndex: Int, groups: TrackGroupArray!): DefaultTrackSelector.ParametersBuilder!

Clears a track selection override for the specified renderer and TrackGroupArray.

Parameters
rendererIndex: Int

The renderer index.

groups: TrackGroupArray!

The TrackGroupArray for which the override should be cleared.

clearSelectionOverrides

@CanIgnoreReturnValue
fun clearSelectionOverrides(): DefaultTrackSelector.ParametersBuilder!

Clears all track selection overrides for all renderers.

clearSelectionOverrides

@CanIgnoreReturnValue
fun clearSelectionOverrides(rendererIndex: Int): DefaultTrackSelector.ParametersBuilder!

Clears all track selection overrides for the specified renderer.

Parameters
rendererIndex: Int

The renderer index.

setAllowAudioMixedChannelCountAdaptiveness

@CanIgnoreReturnValue
fun setAllowAudioMixedChannelCountAdaptiveness(
    allowAudioMixedChannelCountAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive audio selections containing mixed channel counts.

Adaptations between different channel counts may not be completely seamless.

Parameters
allowAudioMixedChannelCountAdaptiveness: Boolean

Whether to allow adaptive audio selections containing mixed channel counts.

setAllowAudioMixedDecoderSupportAdaptiveness

@CanIgnoreReturnValue
fun setAllowAudioMixedDecoderSupportAdaptiveness(
    allowAudioMixedDecoderSupportAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive audio selections with mixed levels of and .

Parameters
allowAudioMixedDecoderSupportAdaptiveness: Boolean

Whether to allow adaptive audio selections with mixed levels of decoder and hardware acceleration support.

setAllowAudioMixedMimeTypeAdaptiveness

@CanIgnoreReturnValue
fun setAllowAudioMixedMimeTypeAdaptiveness(
    allowAudioMixedMimeTypeAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive audio selections containing mixed MIME types.

Adaptations between different MIME types may not be completely seamless, in which case setAllowAudioNonSeamlessAdaptiveness also needs to be true for mixed MIME type selections to be made.

Parameters
allowAudioMixedMimeTypeAdaptiveness: Boolean

Whether to allow adaptive audio selections containing mixed MIME types.

setAllowAudioMixedSampleRateAdaptiveness

@CanIgnoreReturnValue
fun setAllowAudioMixedSampleRateAdaptiveness(
    allowAudioMixedSampleRateAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive audio selections containing mixed sample rates.

Adaptations between different sample rates may not be completely seamless.

Parameters
allowAudioMixedSampleRateAdaptiveness: Boolean

Whether to allow adaptive audio selections containing mixed sample rates.

setAllowMultipleAdaptiveSelections

@CanIgnoreReturnValue
fun setAllowMultipleAdaptiveSelections(
    allowMultipleAdaptiveSelections: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether multiple adaptive selections with more than one track are allowed.

Parameters
allowMultipleAdaptiveSelections: Boolean

Whether multiple adaptive selections are allowed.

setAllowVideoMixedDecoderSupportAdaptiveness

@CanIgnoreReturnValue
fun setAllowVideoMixedDecoderSupportAdaptiveness(
    allowVideoMixedDecoderSupportAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive video selections with mixed levels of and .

Parameters
allowVideoMixedDecoderSupportAdaptiveness: Boolean

Whether to allow adaptive video selections with mixed levels of decoder and hardware acceleration support.

setAllowVideoMixedMimeTypeAdaptiveness

@CanIgnoreReturnValue
fun setAllowVideoMixedMimeTypeAdaptiveness(
    allowVideoMixedMimeTypeAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive video selections containing mixed MIME types.

Adaptations between different MIME types may not be completely seamless, in which case setAllowVideoNonSeamlessAdaptiveness also needs to be true for mixed MIME type selections to be made.

Parameters
allowVideoMixedMimeTypeAdaptiveness: Boolean

Whether to allow adaptive video selections containing mixed MIME types.

setAllowVideoNonSeamlessAdaptiveness

@CanIgnoreReturnValue
fun setAllowVideoNonSeamlessAdaptiveness(
    allowVideoNonSeamlessAdaptiveness: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to allow adaptive video selections where adaptation may not be completely seamless.

Parameters
allowVideoNonSeamlessAdaptiveness: Boolean

Whether to allow adaptive video selections where adaptation may not be completely seamless.

setAudioOffloadPreferences

@CanIgnoreReturnValue
fun setAudioOffloadPreferences(
    audioOffloadPreferences: TrackSelectionParameters.AudioOffloadPreferences!
): DefaultTrackSelector.ParametersBuilder!

Sets the audio offload mode preferences. This includes whether to enable/disable offload as well as to set requirements like if the device must support gapless transitions or speed change during offload.

setDisabledTextTrackSelectionFlags

@CanIgnoreReturnValue
fun setDisabledTextTrackSelectionFlags(
    @C.SelectionFlags disabledTextTrackSelectionFlags: Int
): DefaultTrackSelector.ParametersBuilder!

setDisabledTrackTypes

@CanIgnoreReturnValue
fun setDisabledTrackTypes(disabledTrackTypes: (Mutable)Set<@C.TrackType Int!>!): DefaultTrackSelector.ParametersBuilder!

setExceedAudioConstraintsIfNecessary

@CanIgnoreReturnValue
fun setExceedAudioConstraintsIfNecessary(
    exceedAudioConstraintsIfNecessary: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to exceed the setMaxAudioChannelCount and setMaxAudioBitrate constraints when no selection can be made otherwise.

Parameters
exceedAudioConstraintsIfNecessary: Boolean

Whether to exceed audio constraints when no selection can be made otherwise.

setExceedRendererCapabilitiesIfNecessary

@CanIgnoreReturnValue
fun setExceedRendererCapabilitiesIfNecessary(
    exceedRendererCapabilitiesIfNecessary: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to exceed renderer capabilities when no selection can be made otherwise.

This parameter applies when all of the tracks available for a renderer exceed the renderer's reported capabilities. If the parameter is true then the lowest quality track will still be selected. Playback may succeed if the renderer has under-reported its true capabilities. If false then no track will be selected.

Parameters
exceedRendererCapabilitiesIfNecessary: Boolean

Whether to exceed renderer capabilities when no selection can be made otherwise.

setExceedVideoConstraintsIfNecessary

@CanIgnoreReturnValue
fun setExceedVideoConstraintsIfNecessary(
    exceedVideoConstraintsIfNecessary: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether to exceed the setMaxVideoBitrate, setMaxVideoSize and setMaxVideoFrameRate constraints when no selection can be made otherwise.

Parameters
exceedVideoConstraintsIfNecessary: Boolean

Whether to exceed video constraints when no selection can be made otherwise.

setForceHighestSupportedBitrate

@CanIgnoreReturnValue
fun setForceHighestSupportedBitrate(forceHighestSupportedBitrate: Boolean): DefaultTrackSelector.ParametersBuilder!

Sets whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints.

Parameters
forceHighestSupportedBitrate: Boolean

Whether to force selection of the highest bitrate audio and video tracks.

setForceLowestBitrate

@CanIgnoreReturnValue
fun setForceLowestBitrate(forceLowestBitrate: Boolean): DefaultTrackSelector.ParametersBuilder!

Sets whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints.

Parameters
forceLowestBitrate: Boolean

Whether to force selection of the single lowest bitrate audio and video tracks.

setIgnoredTextSelectionFlags

@CanIgnoreReturnValue
fun setIgnoredTextSelectionFlags(
    @C.SelectionFlags ignoredTextSelectionFlags: Int
): DefaultTrackSelector.ParametersBuilder!

Sets a bitmask of selection flags that are ignored for text track selections.

Parameters
@C.SelectionFlags ignoredTextSelectionFlags: Int

A bitmask of C.SelectionFlags that are ignored for text track selections.

setMaxAudioBitrate

@CanIgnoreReturnValue
fun setMaxAudioBitrate(maxAudioBitrate: Int): DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed audio bitrate.

Parameters
maxAudioBitrate: Int

Maximum allowed audio bitrate in bits per second.

setMaxAudioChannelCount

@CanIgnoreReturnValue
fun setMaxAudioChannelCount(maxAudioChannelCount: Int): DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed audio channel count.

Parameters
maxAudioChannelCount: Int

Maximum allowed audio channel count.

setMaxVideoBitrate

@CanIgnoreReturnValue
fun setMaxVideoBitrate(maxVideoBitrate: Int): DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed video bitrate.

Parameters
maxVideoBitrate: Int

Maximum allowed video bitrate in bits per second.

setMaxVideoFrameRate

@CanIgnoreReturnValue
fun setMaxVideoFrameRate(maxVideoFrameRate: Int): DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed video frame rate.

Parameters
maxVideoFrameRate: Int

Maximum allowed video frame rate in hertz.

setMaxVideoSize

@CanIgnoreReturnValue
fun setMaxVideoSize(maxVideoWidth: Int, maxVideoHeight: Int): DefaultTrackSelector.ParametersBuilder!

Sets the maximum allowed video width and height.

Parameters
maxVideoWidth: Int

Maximum allowed video width in pixels.

maxVideoHeight: Int

Maximum allowed video height in pixels.

setMinVideoBitrate

@CanIgnoreReturnValue
fun setMinVideoBitrate(minVideoBitrate: Int): DefaultTrackSelector.ParametersBuilder!

Sets the minimum allowed video bitrate.

Parameters
minVideoBitrate: Int

Minimum allowed video bitrate in bits per second.

setMinVideoFrameRate

@CanIgnoreReturnValue
fun setMinVideoFrameRate(minVideoFrameRate: Int): DefaultTrackSelector.ParametersBuilder!

Sets the minimum allowed video frame rate.

Parameters
minVideoFrameRate: Int

Minimum allowed video frame rate in hertz.

setMinVideoSize

@CanIgnoreReturnValue
fun setMinVideoSize(minVideoWidth: Int, minVideoHeight: Int): DefaultTrackSelector.ParametersBuilder!

Sets the minimum allowed video width and height.

Parameters
minVideoWidth: Int

Minimum allowed video width in pixels.

minVideoHeight: Int

Minimum allowed video height in pixels.

setOverrideForType

@CanIgnoreReturnValue
fun setOverrideForType(override: TrackSelectionOverride!): DefaultTrackSelector.ParametersBuilder!

Sets an override, replacing all existing overrides with the same track type.

setPreferredAudioLanguage

@CanIgnoreReturnValue
fun setPreferredAudioLanguage(preferredAudioLanguage: String?): DefaultTrackSelector.ParametersBuilder!

Sets the preferred language for audio and forced text tracks.

Parameters
preferredAudioLanguage: String?

Preferred audio language as an IETF BCP 47 conformant tag, or null to select the default track, or the first track if there's no default.

setPreferredAudioLanguages

@CanIgnoreReturnValue
fun setPreferredAudioLanguages(preferredAudioLanguages: Array<String!>!): DefaultTrackSelector.ParametersBuilder!

Sets the preferred languages for audio and forced text tracks.

Parameters
preferredAudioLanguages: Array<String!>!

Preferred audio languages as IETF BCP 47 conformant tags in order of preference, or an empty array to select the default track, or the first track if there's no default.

setPreferredAudioMimeType

@CanIgnoreReturnValue
fun setPreferredAudioMimeType(mimeType: String?): DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME type for audio tracks.

Parameters
mimeType: String?

The preferred MIME type for audio tracks, or null to clear a previously set preference.

setPreferredAudioMimeTypes

@CanIgnoreReturnValue
fun setPreferredAudioMimeTypes(mimeTypes: Array<String!>!): DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME types for audio tracks.

Parameters
mimeTypes: Array<String!>!

The preferred MIME types for audio tracks in order of preference, or an empty list for no preference.

setPreferredAudioRoleFlags

@CanIgnoreReturnValue
fun setPreferredAudioRoleFlags(@C.RoleFlags preferredAudioRoleFlags: Int): DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for audio tracks.

Parameters
@C.RoleFlags preferredAudioRoleFlags: Int

Preferred audio role flags.

setPreferredTextLanguage

@CanIgnoreReturnValue
fun setPreferredTextLanguage(preferredTextLanguage: String?): DefaultTrackSelector.ParametersBuilder!

Sets the preferred language for text tracks.

Parameters
preferredTextLanguage: String?

Preferred text language as an IETF BCP 47 conformant tag, or null to select the default track if there is one, or no track otherwise.

setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings

@CanIgnoreReturnValue
fun setPreferredTextLanguageAndRoleFlagsToCaptioningManagerSettings(
    context: Context!
): DefaultTrackSelector.ParametersBuilder!

Sets the preferred language and role flags for text tracks based on the accessibility settings of CaptioningManager.

Does nothing for API levels <19 or when the CaptioningManager is disabled.

Parameters
context: Context!

A Context.

setPreferredTextLanguages

@CanIgnoreReturnValue
fun setPreferredTextLanguages(preferredTextLanguages: Array<String!>!): DefaultTrackSelector.ParametersBuilder!

Sets the preferred languages for text tracks.

Parameters
preferredTextLanguages: Array<String!>!

Preferred text languages as IETF BCP 47 conformant tags in order of preference, or an empty array to select the default track if there is one, or no track otherwise.

setPreferredTextRoleFlags

@CanIgnoreReturnValue
fun setPreferredTextRoleFlags(@C.RoleFlags preferredTextRoleFlags: Int): DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for text tracks.

Parameters
@C.RoleFlags preferredTextRoleFlags: Int

Preferred text role flags.

setPreferredVideoMimeType

@CanIgnoreReturnValue
fun setPreferredVideoMimeType(mimeType: String?): DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME type for video tracks.

Parameters
mimeType: String?

The preferred MIME type for video tracks, or null to clear a previously set preference.

setPreferredVideoMimeTypes

@CanIgnoreReturnValue
fun setPreferredVideoMimeTypes(mimeTypes: Array<String!>!): DefaultTrackSelector.ParametersBuilder!

Sets the preferred sample MIME types for video tracks.

Parameters
mimeTypes: Array<String!>!

The preferred MIME types for video tracks in order of preference, or an empty list for no preference.

setPreferredVideoRoleFlags

@CanIgnoreReturnValue
fun setPreferredVideoRoleFlags(@C.RoleFlags preferredVideoRoleFlags: Int): DefaultTrackSelector.ParametersBuilder!

Sets the preferred C.RoleFlags for video tracks.

Parameters
@C.RoleFlags preferredVideoRoleFlags: Int

Preferred video role flags.

setPrioritizeImageOverVideoEnabled

@CanIgnoreReturnValue
fun setPrioritizeImageOverVideoEnabled(
    isPrioritizeImageOverVideoEnabled: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether an image track would be selected over a video track if both are available.

Parameters
isPrioritizeImageOverVideoEnabled: Boolean

Whether an image track would be selected over a video track if both are available.

setRendererDisabled

@CanIgnoreReturnValue
fun setRendererDisabled(rendererIndex: Int, disabled: Boolean): DefaultTrackSelector.ParametersBuilder!

Sets whether the renderer at the specified index is disabled. Disabling a renderer prevents the selector from selecting any tracks for it.

Parameters
rendererIndex: Int

The renderer index.

disabled: Boolean

Whether the renderer is disabled.

setSelectUndeterminedTextLanguage

@CanIgnoreReturnValue
fun setSelectUndeterminedTextLanguage(
    selectUndeterminedTextLanguage: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets whether a text track with undetermined language should be selected if no track with a preferred language is available, or if the preferred language is unset.

Parameters
selectUndeterminedTextLanguage: Boolean

Whether a text track with undetermined language should be selected if no preferred language track is available.

setSelectionOverride

@CanIgnoreReturnValue
fun setSelectionOverride(
    rendererIndex: Int,
    groups: TrackGroupArray!,
    override: DefaultTrackSelector.SelectionOverride?
): DefaultTrackSelector.ParametersBuilder!

Overrides the track selection for the renderer at the specified index.

When the TrackGroupArray mapped to the renderer matches the one provided, the override is applied. When the TrackGroupArray does not match, the override has no effect. The override replaces any previous override for the specified TrackGroupArray for the specified Renderer.

Passing a null override will cause the renderer to be disabled when the mapped to it matches the one provided. When the TrackGroupArray does not match a null override has no effect. Hence a null override differs from disabling the renderer using setRendererDisabled because the renderer is disabled conditionally on the TrackGroupArray mapped to it, where-as setRendererDisabled disables the renderer unconditionally.

To remove overrides use clearSelectionOverride, clearSelectionOverrides or clearSelectionOverrides.

Parameters
rendererIndex: Int

The renderer index.

groups: TrackGroupArray!

The TrackGroupArray for which the override should be applied.

override: DefaultTrackSelector.SelectionOverride?

The override.

setTrackTypeDisabled

@CanIgnoreReturnValue
fun setTrackTypeDisabled(@C.TrackType trackType: Int, disabled: Boolean): DefaultTrackSelector.ParametersBuilder!

Sets whether a track type is disabled. If disabled, no tracks of the specified type will be selected for playback.

Parameters
@C.TrackType trackType: Int

The track type.

disabled: Boolean

Whether the track type should be disabled.

setTunnelingEnabled

@CanIgnoreReturnValue
fun setTunnelingEnabled(tunnelingEnabled: Boolean): DefaultTrackSelector.ParametersBuilder!

Sets whether to enable tunneling if possible. Tunneling will only be enabled if it's supported by the audio and video renderers for the selected tracks.

Tunneling is known to have many device specific issues and limitations. Manual testing is strongly recommended to check that the media plays correctly when this option is enabled. See [#9661](https://github.com/google/ExoPlayer/issues/9661), [#9133](https://github.com/google/ExoPlayer/issues/9133), [#9317](https://github.com/google/ExoPlayer/issues/9317), [#9502](https://github.com/google/ExoPlayer/issues/9502).

Parameters
tunnelingEnabled: Boolean

Whether to enable tunneling if possible.

setViewportSize

@CanIgnoreReturnValue
fun setViewportSize(
    viewportWidth: Int,
    viewportHeight: Int,
    viewportOrientationMayChange: Boolean
): DefaultTrackSelector.ParametersBuilder!

Sets the viewport size to constrain adaptive video selections so that only tracks suitable for the viewport are selected.

Parameters
viewportWidth: Int

Viewport width in pixels.

viewportHeight: Int

Viewport height in pixels.

viewportOrientationMayChange: Boolean

Whether the viewport orientation may change during playback.

setViewportSizeToPhysicalDisplaySize

@CanIgnoreReturnValue
fun setViewportSizeToPhysicalDisplaySize(
    context: Context!,
    viewportOrientationMayChange: Boolean
): DefaultTrackSelector.ParametersBuilder!

Equivalent to calling setViewportSize with the viewport size obtained from getCurrentDisplayModeSize.

Parameters
context: Context!

Any context.

viewportOrientationMayChange: Boolean

Whether the viewport orientation may change during playback.

Protected functions

set

@CanIgnoreReturnValue
protected fun set(parameters: TrackSelectionParameters!): DefaultTrackSelector.ParametersBuilder!

Overrides the value of the builder with the value of TrackSelectionParameters.