Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix player menu track selection #1044

Merged
merged 1 commit into from
May 13, 2023
Merged

Conversation

Maxr1998
Copy link
Member

Changes
Because the menus use setGroupCheckable with exclusive=true, it isn't necessary to uncheck the other items. Furthermore, while transcoding, the media source is updated and the menu rebuilt (with the new selections already). This causes the clickedItem to become outdated/invalid in the fragment.onXTrackSelected callback. As a result, the selection will be invalidated. To fix this, we assume that selections are always successful and immediately apply the selection to the clicked item before notifying the fragment.

Issues
Fixes #1024.

Because the menus use setGroupCheckable with exclusive=true, it isn't necessary to uncheck the other items.
Furthermore, while transcoding, the media source is updated and the menu rebuilt (with the new selections already). This causes the clickedItem to become outdated/invalid in the fragment.onXTrackSelected callback. As a result, the selection will be invalidated.
To fix this, we assume that selections are always successful and immediately apply the selection to the clicked item before notifying the fragment.
@Maxr1998 Maxr1998 added bug Something isn't working exoplayer Related to the ExoPlayer integration labels May 13, 2023
@Maxr1998 Maxr1998 added this to the v2.5.0 milestone May 13, 2023
@Maxr1998 Maxr1998 requested a review from nielsvanvelzen May 13, 2023 18:15
@nielsvanvelzen nielsvanvelzen merged commit cf52144 into master May 13, 2023
@nielsvanvelzen nielsvanvelzen deleted the fix-track-selection-menu branch May 13, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exoplayer Related to the ExoPlayer integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selected subtitle track not showing up in player UI and changes audio track
2 participants