From bb3ab1edd7b3adfb1b73e324a57c13c15a18b5f8 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Thu, 24 Sep 2026 22:42:42 -0400 Subject: [PATCH] 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. --- docs/build/build-windows.md | 14 +- docs/requirements.md | 1 + src-tauri/src/conformance_runner.rs | 1 + src-tauri/src/lib.rs | 20 ++- src-tauri/src/player/mpv_backend.rs | 195 +++++++++++++++++++++++++-- src-tauri/src/player/native_video.rs | 23 ++-- src/lib/utils/videoSurface.ts | 17 +++ 7 files changed, 240 insertions(+), 31 deletions(-) diff --git a/docs/build/build-windows.md b/docs/build/build-windows.md index e48a3c731..c3689ff7f 100644 --- a/docs/build/build-windows.md +++ b/docs/build/build-windows.md @@ -7,9 +7,15 @@ job / SMTC lockscreen), but it runs and plays media. ## How playback works on Windows -- **Video** — renders through the webview HTML5 `