Background-audio handoff for video + repository/player refactor

Hand video playback off to a native audio-only stream when the app is
backgrounded or locked, with no on-device video decode (UR-040). Adds
player_enter/exit_background_audio commands, an audio-only stream URL
for video items across the repository layer, and the frontend handoff
state machine wired into VideoPlayer. Includes accompanying
repository/offline/player refactoring and regenerates the traceability
matrix.
This commit is contained in:
2026-07-22 21:52:07 +02:00
parent 4e6ab017d4
commit 3fbf6afdbc
72 changed files with 6728 additions and 2338 deletions
+8 -2
View File
@@ -1,6 +1,8 @@
/**
* Picture-in-picture support, Android only.
*
* TRACES: UR-041 | IR-026 | DR-053
*
* Video on Android renders into a native ExoPlayer SurfaceView behind the
* WebView, so PiP is driven by the Activity (which shrinks into a floating
* window) rather than the HTML5 `requestPictureInPicture()` API. The bridge is
@@ -68,8 +70,12 @@ export function enterPip(): void {
/**
* Enable/disable auto-entering PiP when the user backgrounds the app.
*
* Disabled while casting: playback is happening on another device, so a PiP
* window here would render an empty black box.
* This is a coarse frontend override; the authoritative gate is the native
* `canEnterPip` guard, which already refuses PiP unless a local video surface
* is actively rendering (so audio playback, menu/library browsing, and
* remote/cast sessions never enter PiP regardless of this flag). The only
* caller today is the background-audio toggle, which disarms auto-PiP so the
* two background behaviours stay mutually exclusive.
*/
export function setAutoEnterEnabled(enabled: boolean): void {
try {