Skip to content

Commit

Permalink
Use the current overrides of the player as preset
Browse files Browse the repository at this point in the history
Issue: google/ExoPlayer#10429
PiperOrigin-RevId: 461577039
  • Loading branch information
marcbaechinger authored and rohitjoins committed Jul 21, 2022
1 parent 604ab7f commit 5c2aabc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ This release corresponds to the
* Ensure TalkBack announces the currently active speed option in the
playback controls menu
([#10298](https://github.com/google/ExoPlayer/issues/10298)).
* Use current overrides of the player as preset in
`TrackSelectionDialogBuilder`
([#10429](https://github.com/google/ExoPlayer/issues/10429)).
* RTSP:
* Add RTP reader for H263
([#63](https://github.com/androidx/media/pull/63)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public interface DialogCallback {
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;

/**
Expand All @@ -87,7 +87,7 @@ public TrackSelectionDialogBuilder(
this.title = title;
this.trackGroups = ImmutableList.copyOf(trackGroups);
this.callback = callback;
overrides = Collections.emptyMap();
overrides = ImmutableMap.of();
}

/**
Expand All @@ -110,7 +110,7 @@ public TrackSelectionDialogBuilder(
trackGroups.add(trackGroup);
}
}
overrides = Collections.emptyMap();
overrides = player.getTrackSelectionParameters().overrides;
callback =
(isDisabled, overrides) -> {
TrackSelectionParameters.Builder parametersBuilder =
Expand Down Expand Up @@ -171,7 +171,7 @@ public TrackSelectionDialogBuilder setOverride(@Nullable TrackSelectionOverride
*/
public TrackSelectionDialogBuilder setOverrides(
Map<TrackGroup, TrackSelectionOverride> overrides) {
this.overrides = overrides;
this.overrides = ImmutableMap.copyOf(overrides);
return this;
}

Expand Down

0 comments on commit 5c2aabc

Please sign in to comment.