feat(windows): mpv draws Windows video into the app window

DR-237's video half. mpv now renders Windows video the way
tauri-plugin-libmpv does on Windows: MpvBackend is handed the main
window's HWND and sets it as `wid` before mpv initialises, so mpv draws
as a child of the app window beneath the transparent WebView2, with
vo=gpu-next,gpu. osc, default bindings, VO keyboard and cursor handling
are off, so the Svelte controls drawn over the picture are the only ones.

- video_output() decides per platform (UT-274): Window(hwnd) on Windows,
  RenderApi on Linux, Off without native video. Windows with no handle
  draws nothing rather than letting mpv open a top-level window.
- native_video::enabled() is true on Windows as well, so the frontend
  takes the native path there: NativePlayerAdapter, and the page clears
  its background while video is on screen.
- enableNativeVideoCompositing() no longer logs a missing Android bridge
  as an error on the desktop, where there is no bridge to have.

Verified: every option, wid included, is accepted by the real libmpv on
Linux and by the shipped Windows DLL under wine; the Windows unit suite
passes under wine (949). Not yet seen on real Windows hardware.
This commit is contained in:
2026-09-24 22:42:42 -04:00
parent 4daf172834
commit bb3ab1edd7
7 changed files with 240 additions and 31 deletions
+10 -4
View File
@@ -7,9 +7,15 @@ job / SMTC lockscreen), but it runs and plays media.
## How playback works on Windows
- **Video** — renders through the webview HTML5 `<video>` element (hls.js); on
Windows that is WebView2 (Chromium/Edge), which plays HLS + h264 fine. mpv
takes this over in DR-237's video phase; Linux already made that move.
- **Video** — **mpv**, drawing into the app's own window: `MpvBackend` is
handed the main window's HWND as `wid` before mpv initialises and renders with
`vo=gpu-next,gpu` as a child of it, beneath the transparent WebView2 whose page
clears its background while a video is on screen (`data-native-video`). mpv's
own controller, key bindings and cursor handling are off — the Svelte controls
drawn over it are the only ones. This is the arrangement tauri-plugin-libmpv
ships on Windows (same zhongfly LGPL DLL). **Not yet seen on real Windows
hardware** — if the picture ends up *over* the controls, the z-order of mpv's
child window is the first thing to check.
- **Audio** — **libmpv**, the same `MpvBackend` Linux uses, with `ao=wasapi`.
Volume, EQ, normalization and gapless all go through mpv's filter graph as on
Linux. `libmpv-2.dll` ships beside `jellytau.exe` in the installer.
@@ -87,4 +93,4 @@ Outputs:
1. SMTC (lockscreen / media keys) — not wired on Windows.
2. Code signing — the installer is unsigned.
3. Video through mpv (DR-237) — needs a WebView2-side surface.
3. First run of mpv video on real Windows hardware (DR-237).