Skip to content

[video_player] Adding support for preferred audio language #8980

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

frontyard
Copy link

Added support for preferred audio language to video_player on Android. If underlaying stream/video supports it this will communicate to exoplayer that audio stream for sepcific language should be used if available.

To use this feature developer should pass preferredAudioLanguage as a 2 character ISO langauge code to VideoPlayerOptions when initializing VideoPlayerController. This code should match one of the language specified in the stream, for example (HLS):
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="Italian",LANGUAGE="it",DEFAULT=NO,AUTOSELECT=YES,URI="audio/italian.m3u8"

Platforms that don't have implementation yet will silently ignore this.

This PR implements flutter/flutter#166411

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Sorry, something went wrong.

@camsim99
Copy link
Contributor

Hi, thank you for your contribution! This looks like a great feature to support, but it looks like the tests are failing. Before we review the PR, please see what you can do to resolve the test failures. If you are unsure how to proceed, please reach out for help on the #hackers-new channel.

frontyard and others added 2 commits April 14, 2025 19:07
@frontyard
Copy link
Author

@camsim99 sorry about that, my first packages PR, still wrapping my head around it. I've updated the code and fixed the tests, flutter test is now passing in all the submodules.

@stuartmorgan-g
Copy link
Contributor

Please see step 1 of the instructions for multi-package PRs for the instructions on how to make this PR something that the CI can run tests on without failing all of the checks.

…d-audio-language
@frontyard
Copy link
Author

@stuartmorgan-g followed the instructions and updated pubspecs to use local path dependencies.

@stuartmorgan-g
Copy link
Contributor

Thanks; it looks like CI is now flagging a number of real failures caused by the PR (analysis, Android lint, macOS native tests). The "View details" links for the failing tests will lead to the stdout of the failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants