Commit f828130c by bachinger Committed by Rohit Singh

Use the current overrides of the player as preset

Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
parent 0db07c67
...@@ -65,7 +65,7 @@ public final class TrackSelectionDialogBuilder { ...@@ -65,7 +65,7 @@ public final class TrackSelectionDialogBuilder {
private boolean showDisableOption; private boolean showDisableOption;
@Nullable private TrackNameProvider trackNameProvider; @Nullable private TrackNameProvider trackNameProvider;
private boolean isDisabled; private boolean isDisabled;
private Map<TrackGroup, TrackSelectionOverride> overrides; private ImmutableMap<TrackGroup, TrackSelectionOverride> overrides;
@Nullable private Comparator<Format> trackFormatComparator; @Nullable private Comparator<Format> trackFormatComparator;
/** /**
...@@ -85,7 +85,7 @@ public final class TrackSelectionDialogBuilder { ...@@ -85,7 +85,7 @@ public final class TrackSelectionDialogBuilder {
this.title = title; this.title = title;
this.trackGroups = ImmutableList.copyOf(trackGroups); this.trackGroups = ImmutableList.copyOf(trackGroups);
this.callback = callback; this.callback = callback;
overrides = Collections.emptyMap(); overrides = ImmutableMap.of();
} }
/** /**
...@@ -108,7 +108,7 @@ public final class TrackSelectionDialogBuilder { ...@@ -108,7 +108,7 @@ public final class TrackSelectionDialogBuilder {
trackGroups.add(trackGroup); trackGroups.add(trackGroup);
} }
} }
overrides = Collections.emptyMap(); overrides = player.getTrackSelectionParameters().overrides;
callback = callback =
(isDisabled, overrides) -> { (isDisabled, overrides) -> {
TrackSelectionParameters.Builder parametersBuilder = TrackSelectionParameters.Builder parametersBuilder =
...@@ -169,7 +169,7 @@ public final class TrackSelectionDialogBuilder { ...@@ -169,7 +169,7 @@ public final class TrackSelectionDialogBuilder {
*/ */
public TrackSelectionDialogBuilder setOverrides( public TrackSelectionDialogBuilder setOverrides(
Map<TrackGroup, TrackSelectionOverride> overrides) { Map<TrackGroup, TrackSelectionOverride> overrides) {
this.overrides = overrides; this.overrides = ImmutableMap.copyOf(overrides);
return this; return this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment