You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Overrides not populated by default in TrackSelectionDialogBuilder #10429
When building TrackSelectionDialogBuilder using constructor with the Player argument, builder does not take into account existing overrides and by default the dialog will always select Auto option.
Expected result
In the TrackSelectionDialogBuilder constructor it could already take available overrides from the player instance via player.getTrackSelectionParameters().getOverrides() instead of having empty map:
So that you wouldn't need to explore the source code to understand why the previous selection in the dialog is not pre-selected when opening the dialog again.
Actual result
When constructing TrackSelectionDialogBuilder the overrides are left empty and you have to know that you need to provide them manually via .setOverrides(player.getTrackSelectionParameters().getOverrides())
Media
Not applicable
Bug Report
You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.
TrackSelectionDialogBuilder builder =
new TrackSelectionDialogBuilder(this, "Select tracks", player, C.TRACK_TYPE_VIDEO)
.setOverrides(player.getTrackSelectionParameters().overrides);
I'm not sure about whether not setting the overrides in the constructor is the intended behaviour. It's meant to present the dialog without a pre-selection. The selection then can be done by using the setter TrackSelectionDialogBuilder.setOverrides(Map).
Agreed that it could be the other way around and then to prevent a preselection, an app can do TrackSelectionDialogBuilder.setOverrides(Collections.emptyMap()).
We need to discuss internally whether we want to change this to default to a pre-selection when the player is passed. Do you agree I change this from bug to enhancement? As in, by using the setter you can achieve what you want?
TrackSelectionDialogBuilder builder =
new TrackSelectionDialogBuilder(this, "Select tracks", player, C.TRACK_TYPE_VIDEO)
.setOverrides(player.getTrackSelectionParameters().overrides);
Yes, that's what I do now, just that I had to dig into code a bit to understand why the previous selection was not saved and would always reset. So that waa a bit confusing and unexpected, if you have to use this dialog.
Do you agree I change this from bug to enhancement?
Activity
marcbaechinger commentedon Jul 13, 2022
Thanks for reporting!
To achieve what you want I think you can do
I'm not sure about whether not setting the overrides in the constructor is the intended behaviour. It's meant to present the dialog without a pre-selection. The selection then can be done by using the setter
TrackSelectionDialogBuilder.setOverrides(Map).Agreed that it could be the other way around and then to prevent a preselection, an app can do
TrackSelectionDialogBuilder.setOverrides(Collections.emptyMap()).We need to discuss internally whether we want to change this to default to a pre-selection when the player is passed. Do you agree I change this from bug to enhancement? As in, by using the setter you can achieve what you want?
TheBeastLT commentedon Jul 14, 2022
Yes, that's what I do now, just that I had to dig into code a bit to understand why the previous selection was not saved and would always reset. So that waa a bit confusing and unexpected, if you have to use this dialog.
Sure, that's fine.
Use the current overrides of the player as preset
Use the current overrides of the player as preset
Move release notes for Issue: google/ExoPlayer#10429 to unreleased ch…