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 {
private boolean showDisableOption;
@Nullable private TrackNameProvider trackNameProvider;
private boolean isDisabled;
private Map<TrackGroup, TrackSelectionOverride> overrides;
private ImmutableMap<TrackGroup, TrackSelectionOverride> overrides;
@Nullable private Comparator<Format> trackFormatComparator;
/**
......@@ -85,7 +85,7 @@ public final class TrackSelectionDialogBuilder {
this.title = title;
this.trackGroups = ImmutableList.copyOf(trackGroups);
this.callback = callback;
overrides = Collections.emptyMap();
overrides = ImmutableMap.of();
}
/**
......@@ -108,7 +108,7 @@ public final class TrackSelectionDialogBuilder {
trackGroups.add(trackGroup);
}
}
overrides = Collections.emptyMap();
overrides = player.getTrackSelectionParameters().overrides;
callback =
(isDisabled, overrides) -> {
TrackSelectionParameters.Builder parametersBuilder =
......@@ -169,7 +169,7 @@ public final class TrackSelectionDialogBuilder {
*/
public TrackSelectionDialogBuilder setOverrides(
Map<TrackGroup, TrackSelectionOverride> overrides) {
this.overrides = overrides;
this.overrides = ImmutableMap.copyOf(overrides);
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