MPV_INTEGRATION.md
docs/MPV_INTEGRATION.md
1# mpv integration23Yokan resolves `io.github.kmpmpv:kmp-mpv:0.1.0-SNAPSHOT` from the repository-contained `vendor/kmp-mpv` composite build. A standalone checkout therefore needs no adjacent repository or local Maven publication.45## Backend behavior67| Target | Primary | Fallback |8|---|---|---|9| Android | mpv 0.39.0, bundled for four ABIs | ComposeMediaPlayer if mpv initialization fails |10| Windows x64 | bundled media-kit `libmpv-2.dll` + Compose software frames | ComposeMediaPlayer |11| macOS | bundled media-kit XCFramework binaries + Compose software frames | ComposeMediaPlayer |12| Linux | distribution libmpv + Compose software frames | ComposeMediaPlayer when libmpv is missing |13| iOS arm64 device | embedded media-kit XCFrameworks + software frames | ComposeMediaPlayer if initialization fails |14| iOS simulator | unavailable in the media-kit archive | ComposeMediaPlayer |1516The common controller routes requests with custom headers through Yokan's local media stream proxy, serializes player commands, and mirrors mpv state into the existing UI contract.1718Desktop initializes mpv with `vo=libmpv` and copies its software-rendered BGRA frames into a Compose `ImageBitmap`. Keeping video inside the Compose scene preserves the z-order and input handling of Yokan's playback controls; a heavyweight AWT `Canvas` would otherwise cover those controls on desktop.1920## iOS build2122`iosApp/BuildSharedFramework.sh` builds the Compose framework, runs `vendor/kmp-mpv/scripts/prepare-media-kit-ios.sh` for device builds, copies every native framework into the application Frameworks directory, and signs them when Xcode supplies a signing identity.2324The Xcode target links `Mpv.framework` and `Lua.framework` only for `iphoneos`. The pinned archive has no simulator slice, so simulator builds intentionally avoid those linker flags.2526## Linux prerequisite2728Install the system mpv/libmpv package before launching Yokan. Debian/Ubuntu development environments use `mpv` and `libmpv-dev`. The application catches libmpv initialization failure and retains its previous ComposeMediaPlayer path as a runtime fallback.2930## Native artifact and license audit3132Artifact URLs, SHA-256 checksums, Lua verification, and licensing notes live in `vendor/kmp-mpv/README.md` and `vendor/kmp-mpv/THIRD_PARTY_NOTICES.md`. The pinned Windows binary has GPL features enabled and must be handled as a GPL distribution.33