fix(player): change the audio track, and load subtitles at all

Two faults, both present since v0.0.1, both found and confirmed on a device.

Audio track (DR-258). Jellyfin builds a transcode around one AudioStreamIndex,
so the alternate tracks are not in the stream that arrives — but the native
path only ever called setAudioTrack(n), which indexes ExoPlayer's audio track
*groups*. On Android that is the common case, since any source whose default
audio codec the device cannot decode is transcoded: logcat showed ExoPlayer
holding `Audio tracks: 1` while the menu listed every track in the file, so
each selection warned `Invalid audio track index` and was dropped, leaving the
default track playing with nothing in the UI saying so.

determine_audio_track_switch_strategy now decides by whether the stream in
front of the engine carries the track at all — a direct play still selects in
place, a transcode is re-negotiated at the chosen index and resumed. Where it
resumes is the player's answer rather than the UI's: the native path has no
<video> element to read, so it sends no position, and defaulting that to zero
re-opened the film at the beginning (caught on device before it shipped).

Subtitles (DR-259). The URL was missing its `Stream.` route segment, so every
sideloaded subtitle 404ed; since media3 1.5 a sideloaded text track only
becomes a track group once its file is parsed, so 42 failed fetches left
ExoPlayer with no text tracks and selection warned `available: 0`. Verified
against a live server: the built URL answers 404, the corrected one 200. The
tests that should have caught this asserted the shape of a mock helper that
restated the format string instead of the URL the app requests — so the new
test drives the repository itself, and failed red on the old URL.
This commit is contained in:
2026-08-23 19:15:05 +02:00
parent 231ffae626
commit 64de22bd51
8 changed files with 397 additions and 61 deletions
+24
View File
@@ -9,6 +9,30 @@ generated trace matrix lives in [docs/traceability.md](docs/traceability.md).
For how long each fixed defect had been shipping before it was found, see
[docs/defect-windows.md](docs/defect-windows.md).
## v0.11.1
Two faults that had been present since the first release, both found on a
device: changing the audio track did nothing, and no subtitle would load.
### 🐛 Fixes
- **Changing the audio track changes the audio.** Picking a different language
did nothing on Android — the menu closed, the tick moved, and the original
track kept playing, with nothing saying otherwise. When the server is
converting a film it builds that conversion around *one* audio track, so the
others are not in the stream that arrives; the app was asking the player to
select from tracks it had never been sent. It now asks the server for the
track you picked and resumes where you were. A film playing in its original
form still switches instantly, because there every track really is present.
(UR-021 → DR-258)
- **Subtitles load.** Every subtitle in the list was inert: the address the app
fetched them from was missing a segment, so each request came back "not
found", and a subtitle that never arrives is a subtitle the player cannot
offer. All of them had been failing this way since the first release — the
tests that were supposed to cover the address were checking a copy of it kept
inside the tests, not the one being requested. (UR-020 → DR-259)
## v0.11.0
Video can play through the native renderer on Linux, and the machinery every