feat: multi-track audio selection - #949
Open
Ortes wants to merge 4 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #949 +/- ##
==========================================
+ Coverage 51.21% 56.65% +5.43%
==========================================
Files 25 27 +2
Lines 1728 1811 +83
==========================================
+ Hits 885 1026 +141
+ Misses 843 785 -58 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Ortes
marked this pull request as ready for review
May 31, 2026 20:49
Collaborator
|
@Ortes please resolve the conflicts currently present in this PR. Thanks. |
Ortes
force-pushed
the
feat/audio-tracks-upstream
branch
from
August 12, 2026 06:20
98901d7 to
1d7e684
Compare
Ortes
added a commit
to Ortes/chewie
that referenced
this pull request
Aug 12, 2026
Mirror the subtitle-track support for audio: the controller now holds a source-agnostic list of selectable AudioTracks, an active id and an onAudioTrackChanged callback. Unlike subtitles, audio is never "off" — one track is always active, and the menu entry only shows when more than one track exists. - ChewieController: audioTracks / activeAudioTrackId / onAudioTrackChanged / hasAudioTracks, setAudioTracks, selectAudioTrack; copyWith wired. - Material + Material desktop controls: an Audio entry in the options menu opening a track picker. - AudioTrackDialog widget + AudioTrack model. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add tests for the new audio-track feature so the patch is exercised and codecov/patch stops reporting 0% on the changed lines: - AudioTrack model: equality, hashCode, toString, optional language - ChewieController: hasAudioTracks, setAudioTracks, selectAudioTrack, copyWith propagation, onAudioTrackChanged callback - AudioTrackDialog widget: tile rendering, selection check icon, language hint, tap-to-pick and dismiss-with-null - MaterialControls & MaterialDesktopControls: options menu surfaces the Audio entry only when >1 track and drives selection end to end Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ortes
force-pushed
the
feat/audio-tracks-upstream
branch
from
August 15, 2026 11:13
0d2d3dc to
f012612
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Streaming sources (notably HLS) expose multiple audio renditions (languages, commentary, codecs) in their manifest, but Chewie has no UI to switch between them. This adds a source-agnostic audio-track picker to the Material controls.
What this adds
The widget is source-agnostic: the host populates the track list and performs the actual rendition switch; Chewie never assumes HLS or any particular backend.
API (all opt-in — defaults preserve current behavior)
ChewieController:List<AudioTrack> audioTracks— selectable tracks (default empty).Object? activeAudioTrackId— currently selected id.void Function(AudioTrack)? onAudioTrackChanged— selection callback.setAudioTracks()/selectAudioTrack()— for tracks known only after load.bool get hasAudioTracks— true only whenlength > 1; gates the menu entry.New:
AudioTrackmodel andAudioTrackDialogbottom sheet.Backwards compatibility
Fully backwards compatible — every field is optional and defaults to the current behavior. No menu entry appears unless the host provides more than one track.
Testing
dart analyze— no issues.Independent of the subtitle-track PR (#948) — single commit, based on
master.