public final class TrackSelectionDialogBuilder extends Object
TrackSelectionView.| Modifier and Type | Class | Description |
|---|---|---|
static interface |
TrackSelectionDialogBuilder.DialogCallback |
Callback which is invoked when a track selection has been made.
|
| Constructor | Description |
|---|---|
TrackSelectionDialogBuilder(Context context,
CharSequence title,
DefaultTrackSelector trackSelector,
int rendererIndex) |
Creates a builder for a track selection dialog which automatically updates a
DefaultTrackSelector. |
TrackSelectionDialogBuilder(Context context,
CharSequence title,
MappingTrackSelector.MappedTrackInfo mappedTrackInfo,
int rendererIndex,
TrackSelectionDialogBuilder.DialogCallback callback) |
Creates a builder for a track selection dialog.
|
| Modifier and Type | Method | Description |
|---|---|---|
Dialog |
build() |
Builds the dialog.
|
TrackSelectionDialogBuilder |
setAllowAdaptiveSelections(boolean allowAdaptiveSelections) |
Sets whether adaptive selections (consisting of more than one track) can be made.
|
TrackSelectionDialogBuilder |
setAllowMultipleOverrides(boolean allowMultipleOverrides) |
Sets whether multiple overrides can be set and selected, i.e.
|
TrackSelectionDialogBuilder |
setIsDisabled(boolean isDisabled) |
Sets whether the selection is initially shown as disabled.
|
TrackSelectionDialogBuilder |
setOverride(DefaultTrackSelector.SelectionOverride override) |
Sets the initial selection override to show.
|
TrackSelectionDialogBuilder |
setOverrides(List<DefaultTrackSelector.SelectionOverride> overrides) |
Sets the list of initial selection overrides to show.
|
TrackSelectionDialogBuilder |
setShowDisableOption(boolean showDisableOption) |
Sets whether an option is available for disabling the renderer.
|
TrackSelectionDialogBuilder |
setTheme(int themeResId) |
Sets the resource ID of the theme used to inflate this dialog.
|
void |
setTrackFormatComparator(Comparator<Format> trackFormatComparator) |
Sets a
Comparator used to determine the display order of the tracks within each track
group. |
TrackSelectionDialogBuilder |
setTrackNameProvider(TrackNameProvider trackNameProvider) |
Sets the
TrackNameProvider used to generate the user visible name of each track and
updates the view with track names queried from the specified provider. |
public TrackSelectionDialogBuilder(Context context, CharSequence title, MappingTrackSelector.MappedTrackInfo mappedTrackInfo, int rendererIndex, TrackSelectionDialogBuilder.DialogCallback callback)
context - The context of the dialog.title - The title of the dialog.mappedTrackInfo - The MappingTrackSelector.MappedTrackInfo containing the track information.rendererIndex - The renderer index in the mappedTrackInfo for which the track
selection is shown.callback - The TrackSelectionDialogBuilder.DialogCallback invoked when a track selection has been made.public TrackSelectionDialogBuilder(Context context, CharSequence title, DefaultTrackSelector trackSelector, int rendererIndex)
DefaultTrackSelector.context - The context of the dialog.title - The title of the dialog.trackSelector - A DefaultTrackSelector whose current selection is used to set up
the dialog and which is updated when new tracks are selected in the dialog.rendererIndex - The renderer index in the trackSelector for which the track
selection is shown.public TrackSelectionDialogBuilder setTheme(@StyleRes int themeResId)
themeResId - The resource ID of the theme.public TrackSelectionDialogBuilder setIsDisabled(boolean isDisabled)
isDisabled - Whether the selection is initially shown as disabled.public TrackSelectionDialogBuilder setOverride(@Nullable DefaultTrackSelector.SelectionOverride override)
override - The initial override to show, or null for no override.public TrackSelectionDialogBuilder setOverrides(List<DefaultTrackSelector.SelectionOverride> overrides)
Note that only the first override will be used unless setAllowMultipleOverrides(boolean) is set to true.
overrides - The list of initial overrides to show. There must be at most one override for
each track group.public TrackSelectionDialogBuilder setAllowAdaptiveSelections(boolean allowAdaptiveSelections)
For the selection view to enable adaptive selection it is necessary both for this feature to be enabled, and for the target renderer to support adaptation between the available tracks.
allowAdaptiveSelections - Whether adaptive selection is enabled.public TrackSelectionDialogBuilder setAllowMultipleOverrides(boolean allowMultipleOverrides)
allowMultipleOverrides - Whether multiple track selection overrides are allowed.public TrackSelectionDialogBuilder setShowDisableOption(boolean showDisableOption)
showDisableOption - Whether the disable option is shown.public void setTrackFormatComparator(@Nullable
Comparator<Format> trackFormatComparator)
Comparator used to determine the display order of the tracks within each track
group.trackFormatComparator - The comparator, or null to use the original order.public TrackSelectionDialogBuilder setTrackNameProvider(@Nullable TrackNameProvider trackNameProvider)
TrackNameProvider used to generate the user visible name of each track and
updates the view with track names queried from the specified provider.trackNameProvider - The TrackNameProvider to use, or null to use the default.public Dialog build()