-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 caption auto-selection not reflected in player GUI #8150
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
fixed: player caption selection skipping on multiple language variants.
I have tested a bit, so far so good. But now having english (united kingdom) and choosing a video with english (automatic) or vise versa unselects the captions. I preferred the previous behaviour actually. If I understood correctly you wanted to make sure that if both (united kingdom) and (automatic) are available it would keep the previous. But this now feels like a downgrade when not both are available at the same time. |
…ersion between videos.
I think this is the default behavior for Youtube browser player, probably why it is replicated on ExoPlayer as default behavior. This is now fixed by using multiple preferred languages in ExoPlayer caption support, though it requires parsing for the "stem" of language descriptor: e.g. |
Tested again. I just tested a video with english (united kingdom) and then switched to another video which has both english (automatisch erzeugt) and english (united states). It appears to be random / nondeterministic. Sometimes cc even get's competely unselected. I don't know what's happening there. |
Thanks for testing, not sure how I missed this one.
I'm not able to reprod this one. Could you test the updated apk and provide some steps if this still happens? |
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested again, working now as expected. Thank you!
What is it?
Description of the changes in your PR
This PR fixes an issue introduced by #8020, where
CustomTrackSelector
was replaced byDefaultTrackSelector
, delegating preferred caption language selection to ExoPlayer instead. When transitioning from a video with manual subtitles selected, e.g.english
, to a video with only auto-generated subtitles, e.g.english (auto-generated)
, ExoPlayer would apply the previously selected language as preferred language and use the auto-generated subtitles instead of disabling captions. This is not reflected in the GUI since it is still trying to find that previously selected language in the list of available languages for the second video, which isn't there, so the GUI showsNo Captions
. This is fixed by looking at the currently select tracksonTracksInfoChanged
, and show the ExoPlayer's selected tracks instead.This change also fixes an unreported caption bug when selecting language variants, where a video has one caption language with multiple formats in parentheses, e.g.
english (auto-generated)
andenglish (united kingdom)
in this order. When any variant of a language is selected (e.g.english (auto-generated)
), the selected caption would jump to the last variant of a language group instead, in this case,english (united kingdom)
. This happens because of parentheses detection logic when settinguserPreferredLanguage
, and is also fixed by delegating preferred language selection to ExoPlayer.Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence