mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
Adds experimental embedded MPV support for Windows and Linux, expands packaging/runtime validation, and updates CI coverage for the cross-platform native addon.
3.1 KiB
3.1 KiB
Embedded MPV for Windows and Linux
Summary
Add support through three implementation slices:
- Foundation: extract the shared libmpv session/IPC core from the macOS-only native source and generalize build/runtime/package contracts without enabling new platforms.
- Windows: add a Windows x64 backend using
HWNDplus mpvwid, runtime staging, packaging, and CI verification. - Linux: add a Linux x64 X11/Xwayland backend using an X11
Windowplus mpvwid, runtime staging, packaging, and CI verification.
Reuse the current Angular UI, IPC bridge, EmbeddedMpvSession contract, Settings support probe, polling/session logic, recording path logic, and E2E infrastructure. The main work is native addon structure, runtime tooling, package verification, and GitHub Actions.
Key Changes
- Split
apps/electron-backend/native/src/embedded_mpv.mminto shared C++ session/event/command code plus platform backends. - Keep macOS render backend behavior unchanged.
- Add Windows x64 and Linux x64 platform backends while preserving existing N-API exports.
- Generalize
vendor/embedded-mpv/<platform>-<arch>/beyonddarwin-*, addingwin32-x64andlinux-x64. - Replace macOS-only build/stage helpers with cross-platform helpers, keeping macOS script names as compatibility wrappers.
- Bundle only LGPL-compatible dynamic runtimes with manifests; release builds reject system-package/Homebrew-style runtime origins.
- Update
electron-builder.jsonto unpack/copy.node,.dylib,.dll,.so,.so.*, and runtime manifests. - Extend package layout verification for macOS, Windows, and Linux.
- Keep existing renderer IPC shape;
EmbeddedMpvSupport.platformmay now reportwin32orlinux. - Show Embedded MPV in Settings on Windows/Linux only when
getEmbeddedMpvSupport()reportssupported: true. - Extend
.github/workflows/build-and-make.yamlwith platform/arch-aware embedded MPV cache keys and runtime build/stage steps.
Test Plan
pnpm nx test electron-backend: platform support matrix, missing runtime reasons, addon candidate paths, recording/session behavior after native split.pnpm nx test web: Settings option visibility fordarwin,win32,linux, unsupported arch, and unsupported Wayland.pnpm nx test ui-playback: embedded player capability-driven controls remain stable.pnpm nx test packaging:electron-builder.json,asarUnpack, runtime manifest, and package layout checks for.dll/.so.pnpm nx run electron-backend:build-embedded-mpvon macOS, Windows x64, and Linux x64.pnpm run build:backend.pnpm run verify:package-layout -- macos <arch>,-- windows x64, and-- linux x64.- Extend
electron-backend-e2e:e2e-ci--src/settings.e2e.ts. - For supported OSes, run Electron with CDP port
9222and verify withagent-browser --cdp 9222 tab,snapshot -i, andscreenshot.
Assumptions
- v1 supports Windows x64 and Linux x64 X11/Xwayland only.
- Linux native Wayland support is out of scope for these PRs because Electron and mpv embedding both have platform limitations there.
- Existing macOS behavior must not regress.