Repository navigation
feat(player): play embedded text subtitles from the transcode's HLS stream - #611
Conversation
Advertise hls_subtitle_renditions_v1 when the HLS delivery is Media3's own pipeline (native_hls_playback_v1), so Cast keeps its sidecars. A server_transcode_hls plan with subtitle.hls_rendition is validated, and its selected inventory row is projected with the rendition and no URL, so the whole-file extraction is never mounted. The rendition is an exact server selection, modelled on the native embedded decision: phone and TV select the manifest track by Media3's GROUP-ID:NAME format id (falling back to a single non-sidecar track labelled NAME), commit only after it is selected, and on a failed mount replan failure_recovery with subtitle_hls_rendition_failed so the server returns the sidecar plan without tearing down video. Replan and seek-reanchor checks accept and compare the rendition. Vendor the server's hls-subtitle-rendition-decision_response.json fixture.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Visible playback effect: a selected embedded text subtitle can now come from the HLS transcode, appearing during playback instead of waiting for whole-file sidecar extraction (
Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Problem
Related issue: Silo-Server/silo-server#1406
Validation tasks: changes #323 C4, #324 C4; likely helps C2 on the same tasks for forced tracks on large files.
When the server transcodes a video and the viewer picks a text subtitle stored inside the file, the app mounts a sidecar subtitle that the server builds by reading the whole video. On network storage that takes minutes. The video plays, but no subtitles show until the read finishes. Switching quality mid-movie, which moves direct play to a transcode, does the same.
With Silo-Server/silo-server#2620 (manual: Silo-Server/siloserver.org#229) the server can carry that subtitle inside the transcode's HLS stream. This PR has the phone and TV apps ask for that and play it.
Approach
hls_subtitle_renditions_v1only when Media3 plays the HLS itself (native_hls_playback_v1), so Cast keeps its sidecars. Aserver_transcode_hlsplan withsubtitle.hls_renditionis validated, and the selected track gets no sidecar URL.GROUP-ID:NAMEformat ID, with a single non-sidecar track namedNAMEas a fallback. The selection counts as applied only once Media3 has selected it.subtitle_hls_rendition_failed. The server returns the sidecar plan without restarting the video.docs/playback/README.mddescribes the flow.Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-611/
Surface and build: Android 16 emulator (Pixel 8 profile), this branch. Before uses the server's
mainbuild; after uses Silo-Server/silo-server#2620. Same file, storage throttle and start position. Tablet and foldable use the same phone player and were not captured. Android TV has its own selection code, which unit tests cover; it was not captured on a device.Risks
Checklist
AI Disclosure