Skip to content

fix(transcoding): audio selection for direct files without native track support - #22

Merged
orochibraru merged 5 commits into
orochibraru:mainfrom
shethshlok:fix/browser-audio-track-selection
Oct 5, 2026
Merged

orochibraru merged 5 commits into
orochibraru:mainfrom
shethshlok:fix/browser-audio-track-selection

Conversation

@shethshlok

@shethshlok shethshlok commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

The startup probe skips the transmux pipeline when a direct MP4 or MKV file's default audio already plays. In browsers without HTMLMediaElement.audioTracks, this leaves the player with no track list. The Audio menu stays hidden even when the file contains multiple playable audio tracks.

Keep the existing transmux pipeline for these multi-track files when the browser lacks native track selection. The existing Audio menu can then switch tracks. Single-track files and browsers with native track selection keep their current playback path. HLS playback is unchanged.

This uses the existing codec and source-access checks. Files that the browser cannot read through CORS, or whose codecs the pipeline cannot handle, still cannot expose alternate tracks.

Type of change

  • Bug fix
  • Tests

Related issues

Fixes #23. The issue includes reproduction steps, a generated-media fixture and regression-test logs.

Validation

  • The new missing-selector test fails with upstream's original transmux-session.ts and passes with this fix. Issue fix: Audio menu missing for multi-track direct files without native track support #23 includes the failure output.
  • bun run check passed with no errors. The service-worker check still reports the existing warning about having no Svelte input files.
  • All 23 focused player tests passed. The new tests cover missing native track support, native track support, single-track playback and preferred audio language.
  • Biome passed for all four changed files.
  • Tested the actual player in Chromium with a generated H.264/AAC file containing English and Hindi audio tracks. Both menu options appeared, and playback continued when switching in both directions. Captured audio changed between the fixture's 440 Hz and 880 Hz tones.

Screenshots

No screenshots attached. The playback check above verified both the menu selection and the resulting audio.

Checklist

  • My code follows the project's code style.
  • I have reviewed the changes.
  • I have added tests for the changed behavior.
  • I have updated the affected code comments.
  • My changes introduce no new warnings or errors in the checks above.

@orochibraru

Copy link
Copy Markdown
Owner

Hey, I'm looking into this.
Realising that my CI setup isn't fork-friendly, I'll fix that asap do E2E can run.

@shethshlok

Copy link
Copy Markdown
Contributor Author

Thanks!

@orochibraru orochibraru changed the title Fix audio selection for direct files without native track support fix(transcoding): audio selection for direct files without native track support Oct 4, 2026
@orochibraru orochibraru added the bug Something isn't working label Oct 4, 2026

@orochibraru orochibraru left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from a few comments, LGTM!
Thank you for submitting a PR.

Comment thread src/lib/player/transmux-session.test.ts Outdated
Comment thread src/lib/player/transmux-session.ts Outdated
@shethshlok

Copy link
Copy Markdown
Contributor Author

I've pushed the updates based on your recommendations. The test import is now at the top of the file, and the audio fallback condition uses separate checks. Biome, type checks and all 918 unit tests passed locally.

Thank you for reviewing my PR and welcoming my contribution to the project. I've been using it actively over the past week, and I'd love to contribute more. If I find any issues, I'll report them and work on PRs to fix them.

@orochibraru
orochibraru merged commit 2b589c1 into orochibraru:main Oct 5, 2026
10 checks passed
orochibraru pushed a commit that referenced this pull request Oct 5, 2026
## [1.0.18](v1.0.17...v1.0.18) (2026-10-05)

### Features

* fork e2e tests ([354d943](354d943))
* sveltekit3 stable (#21) ([810404e](810404e))

### Bug Fixes

* **transcoding:** audio selection for direct files without native track support (#22) ([2b589c1](2b589c1))
@github-actions github-actions Bot mentioned this pull request Oct 5, 2026
orochibraru pushed a commit that referenced this pull request Oct 5, 2026
## [1.0.18](v1.0.17...v1.0.18) (2026-10-05)

### Features

* fork e2e tests ([354d943](354d943))
* sveltekit3 stable (#21) ([810404e](810404e))

### Bug Fixes

* **transcoding:** audio selection for direct files without native track support (#22) ([2b589c1](2b589c1))
orochibraru pushed a commit that referenced this pull request Oct 5, 2026
## [1.0.18](v1.0.17...v1.0.18) (2026-10-05)

### Features

* fork e2e tests ([354d943](354d943))
* sveltekit3 stable (#21) ([810404e](810404e))

### Bug Fixes

* **transcoding:** audio selection for direct files without native track support (#22) ([2b589c1](2b589c1))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Audio menu missing for multi-track direct files without native track support

2 participants