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

Close caption menu with the Unknown label for the Português language #988

Open
1 task
elimasword opened this issue Jan 17, 2024 · 2 comments
Open
1 task
Assignees

Comments

@elimasword
Copy link

Version

Media3 1.2.0

More version details

No response

Devices that reproduce the issue

Pixel 6 running Android 14

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

In my application, we are creating a fullscreen player view where we create a builder of the exoplayer and pass the media that we want to play into it. In that media, we have close captions in two languages, we have English and Português.
When the player is loaded and I click on the close captions button to open the menu to select the languages I get the options "None", "English" and "Unknown", this last one is not correct.

Screenshot 2024-01-17 at 09 26 10

After doing some debugging, I noticed that in the DefaultTrackNameProvider existed this chunk of code in which the returning language string is empty

Screenshot 2024-01-17 at 09 17 37

Is it possible for the fallback here to be the format.language value and not an empty language, and rely on the values of the language labels defined in the captions of the media?

Expected result

Have the correct language labels in the menu of the close captions

Actual result

Have the "Unknown" label for "Português" language

Media

Screenshot 2024-01-17 at 09 26 10

Bug Report

@microkatz
Copy link
Contributor

Hello @elimasword,

The Format.language in that section of code from your screencapture shouldn't have "português" as that is not a valid IETF BCP 47 language tag. It should be "pt".

I tested that if the format.language was "pt" then languageLocale.getDisplayName would return "português".

Can I ask what media you are trying to play and if you may provide it? It may be that the media is providing an incorrect language tag value in its manifest or container.

@elimasword
Copy link
Author

elimasword commented Jan 18, 2024

@microkatz Ok yes, we have an issue there but shouldn't in these cases where the languageName is empty the return be the value that we have in format.language to avoid displaying "Unknown"

copybara-service bot pushed a commit that referenced this issue Feb 12, 2024
copybara-service bot pushed a commit to google/ExoPlayer that referenced this issue Feb 12, 2024
SheenaChhabra pushed a commit that referenced this issue Apr 8, 2024
Issue: #988
PiperOrigin-RevId: 606193299
(cherry picked from commit 0b0c419)
l1068 pushed a commit to l1068org/media that referenced this issue Apr 15, 2024
Issue: androidx#988
PiperOrigin-RevId: 606193299
(cherry picked from commit 0b0c419)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants