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:
Vendored
+10
-4
@@ -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).
|
||||
|
||||
@@ -869,6 +869,7 @@ Internal architecture, components, and application logic.
|
||||
| UT-271 | Native video is on for Linux whatever `JELLYTAU_NATIVE_VIDEO` says, including unset and explicit "off" values, and off where mpv is not the video renderer | DR-235 | Done |
|
||||
| UT-272 | No platform reports a webview video fallback, Linux reports native video, and the player status on Linux never sends video to the `<video>` element | DR-235 | Done |
|
||||
| UT-273 | `player_play_item`, `get_player_status` and `player_get_capabilities` answer "does a native renderer draw video here" from one function, so the backend is loaded with video exactly where the frontend is told not to use a `<video>` element — on Windows, where mpv now plays audio, the film's soundtrack is not decoded twice | DR-237 | Done |
|
||||
| UT-274 | mpv's video output is decided per platform: Windows renders into the app window's HWND (`wid`, set before initialisation) with `vo=gpu-next,gpu` and mpv's own controller, bindings and cursor handling off; Windows with no handle draws nothing rather than opening a window of its own; Linux uses the render API; no native video means `video=no`. Every option is accepted by the real libmpv, on Linux and by the shipped Windows DLL | DR-237 | Done |
|
||||
### Integration Tests
|
||||
|
||||
| Test ID | Test Description | Traces To | Status |
|
||||
|
||||
Reference in New Issue
Block a user