feat(darwin): add Swift Package Manager support pointing at Predidit/libmpv-darwin-build 0.6.7#31
Merged
Conversation
Revert the deployment target bumps (macOS 10.15→10.9, iOS 13.0→9.0). The lower values match the actual targets encoded in the xcframework binaries from media-kit/libmpv-darwin-build and should be preferred.
The minimum Flutter version was bumped to 3.27.4 to support Swift Package Manager, but CocoaPods is still supported. There is no reason to force developers onto a recent Flutter version until SPM becomes the only supported option.
Previously, the SPM manifests for iOS and macOS unconditionally declared
`media_kit_libs_{ios,macos}_video` as a required dependency, causing the
build to fail if the package was not included in the developer's
`pubspec.yaml`.
The dependency is now resolved dynamically at manifest evaluation time by
checking whether the sibling package directory exists in the SPM ephemeral
packages directory. If found, `media_kit_video` is linked against it as
before; otherwise it falls back to a stub implementation, mirroring the
existing CocoaPods behavior in `media_kit_utils.rb`.
Note: after adding or removing the libs package from `pubspec.yaml`,
the SPM cache must be cleared manually:
rm -rf ~/Library/Caches/org.swift.swiftpm/
The 7 cherry-picked SPM commits from upstream (b505adf..672ac77) reference upstream media-kit/libmpv-darwin-build v0.7.0 binaries, which are vanilla libmpv without this fork's ad-blocker and other patches. Switch libmpvArtifactBase + checksums in both libs Package.swift files to Predidit/libmpv-darwin-build 0.6.7, which is built from this fork's mpv source (with ad-blocker + ohos + win32 + other fork-specific patches) and includes the SPM zip + framework module map work merged in Predidit/libmpv-darwin-build#4. This preserves all fork customizations when downstream consumers integrate via Swift Package Manager. Verified end-to-end with Predidit/Kazumi: - flutter build macos --release / iOS --release succeeded - codesign --verify --deep on .app passes - All 18 SPM-downloaded xcframeworks verify as signed
Predidit
pushed a commit
to Predidit/Kazumi
that referenced
this pull request
May 23, 2026
…inappwebview (#2119) * feat: bump flutter_volume_controller to 2.0.0 for SPM support flutter_volume_controller 2.0.0 (released 2026) adds Swift Package Manager support for iOS and macOS, along with HarmonyOS (OHOS) support. Upgrading from ^1.3.2 to ^2.0.0 lets Flutter integrate the plugin via SPM instead of CocoaPods on Darwin, reducing the CocoaPods fallback list: - macOS: 6 → 5 plugins still on CocoaPods - iOS: 7 → 6 plugins still on CocoaPods No API changes — existing FlutterVolumeController.getVolume / setVolume / updateShowSystemUI / addListener / removeListener usage in player_controller and player_playback_controller continue to work. Verified via flutter analyze (no issues) and flutter build macos --debug. * feat: bump media_kit fork ref to 13b332ad for SPM integration 媒体_kit fork (Predidit/media-kit) 在 [PR #31](Predidit/media-kit#31) 合入了 Swift Package Manager 适配,使 media_kit_video / media_kit_libs_{ios,macos}_video 可以在 Flutter 3.44 默认 SPM 模式下直接接入,不再走 CocoaPods 兜底。 把 pubspec.yaml 中 9 处 media_kit* 的 git ref 从 21aacaf9 (旧 fork main 头) 升到 13b332ad (PR #31 merge commit)。新 Package.swift 通过 .binaryTarget(url:) 指向 Predidit/libmpv-darwin-build 0.6.7 release 的 per-framework zip,保留 fork 的 ad-blocker 等定制 patch。 效果:CocoaPods 兜底插件数从 PR #2100 后的状态进一步缩减: - macOS: 6 → 3 (移除 media_kit_video / media_kit_libs_macos_video / flutter_volume_controller) - iOS: 7 → 4 (移除 media_kit_video / media_kit_libs_ios_video / flutter_volume_controller) 剩余 CocoaPods 兜底插件: - macOS (3): screen_retriever_macos, tray_manager, flutter_inappwebview_macos - iOS (4): saver_gallery, open_filex, flutter_inappwebview_ios, flutter_foreground_task 本地验证: - flutter pub get: SPM 列表含 media_kit_video / media_kit_libs_macos_video / flutter_volume_controller-2.0.0 - flutter build macos --release: Built Kazumi.app (123.7MB) - flutter build ios --release --no-codesign: Built Runner.app (61.6MB) - codesign --verify --deep on .app: valid + satisfies its Designated Requirement - iOS unsigned IPA 真机自签后运行正常 (含 ad-blocker patch) ref: - Predidit/media-kit#31 - Predidit/libmpv-darwin-build#4 - https://github.com/Predidit/libmpv-darwin-build/releases/tag/0.6.7 * feat: bump flutter_inappwebview to 1.2.0-beta.3 for SPM support flutter_inappwebview 1.2.0-beta.3 (platform_interface 1.4.0-beta.3) adds Swift Package Manager support for iOS and macOS. The beta line has been running since 2024-11 (~18 months) while the stable line has been frozen at 1.1.x since 2024-10 — maintainer is shipping SPM + many new features through the beta channel, so adopting beta is the practical path. Bumps: - flutter_inappwebview_platform_interface: ^1.3.0+1 → ^1.4.0-beta.3 - flutter_inappwebview_ios: ^1.1.2 → ^1.2.0-beta.3 - flutter_inappwebview_macos: ^1.1.2 → ^1.2.0-beta.3 - flutter_inappwebview_android: ^1.1.3 → ^1.2.0-beta.3 Final CocoaPods fallback count after this commit: - macOS: 3 → 2 (removes flutter_inappwebview_macos) - iOS: 4 → 3 (removes flutter_inappwebview_ios) Remaining CocoaPods fallback (waiting on upstream SPM adoption): - macOS (2): screen_retriever_macos, tray_manager - iOS (3): saver_gallery, open_filex, flutter_foreground_task API compatibility verified — Kazumi's WebView code in lib/webview/video/impl/ uses lambdas for JavaScript handlers and load callbacks, which remain compatible with the beta API (deprecated typedef JavaScriptHandlerCallback is only referenced indirectly; Future → FutureOr return type widening is backward compatible with async lambdas). Verified locally: - flutter analyze lib/webview/: no errors, no deprecation warnings - flutter build macos --release: Built Kazumi.app (129.3MB) - flutter build ios --release --no-codesign: Built Runner.app (64.6MB) - codesign --verify --deep: valid + satisfies its Designated Requirement - Runtime: video parsing + playback + danmaku + ad-blocker behavior unchanged across multiple plugin sources on macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #30 —— PR #30 漏了一个关键点:cherry-pick 来的 `Package.swift` 还指着上游 `media-kit/libmpv-darwin-build v0.7.0` 的 vanilla libmpv binary,会静默丢失本 fork 的 ad-blocker 等定制 patch。本 PR 是 #30 的修正版本,按用户工作习惯保留 #30 作为历史/讨论记录,新开本 PR 作为最终交付。
改动构成
本 PR 含 8 个 commit:
为什么 commit 8 必需
`Predidit/libmpv-darwin-build/0.6.7` 是 Predidit/libmpv-darwin-build#4 合入后产出的首个 SPM-aware release,含:
端到端验证
在 Predidit/Kazumi 上用 path override 指向本 PR 分支测试:
证明:fork SPM zip 二进制能被 Xcode 正确签名嵌入到 .app,分发链路(含 App Store / 公证 / 真机自签)的下一步无新增障碍。
文件改动
仅修改 2 个 `Package.swift`:
每文件改动包含:1 行 `libmpvArtifactBase` + 18 行 sha256 替换。
不在 scope 内
下游计划
合入本 PR 后,Predidit/Kazumi 可以新开 PR 把 `pubspec.yaml` 中的 `media_kit` / `media_kit_video` / `media_kit_libs_video` 等 git `ref` bump 到本 PR 的 merge commit,让 macOS / iOS 集成把 `media_kit_video` / `media_kit_libs_{ios,macos}_video` 从 CocoaPods 兜底迁到 SPM。届时 macOS 兜底插件数 6→3, iOS 7→4。