fix native playback cocoa pods build

This commit is contained in:
dirtydishes 2026-05-25 00:24:13 -04:00
parent 6e220e6df9
commit 511224bcd4
9 changed files with 386 additions and 5 deletions

View file

@ -368,6 +368,12 @@ final class DreamioWebViewController: UIViewController {
@MainActor
private func resolveAndPresentNativePlayback(_ request: NativePlaybackRequest) async {
guard VLCNativePlaybackBackend.isAvailable else {
lastNativePlaybackURL = nil
showNativePlaybackUnavailableAlert()
return
}
do {
let resolved = try await streamResolver.resolve(request: request)
#if DEBUG
@ -407,6 +413,16 @@ final class DreamioWebViewController: UIViewController {
present(alert, animated: true)
}
private func showNativePlaybackUnavailableAlert() {
let alert = UIAlertController(
title: "Native playback needs CocoaPods",
message: "This build was opened from Dreamio.xcodeproj or built before MobileVLCKit was installed. Run pod install, open Dreamio.xcworkspace, then build again to play MKV, AVI, and WebM streams.",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "Close", style: .cancel))
present(alert, animated: true)
}
#if DEBUG
private func logDiagnostic(type: String, payload: Any, pageURL: String?) {
let redactedPageURL = pageURL.map(redactedURLString) ?? "unknown"

View file

@ -5,6 +5,14 @@ import MobileVLCKit
#endif
final class VLCNativePlaybackBackend: NSObject, NativePlaybackBackend {
static var isAvailable: Bool {
#if canImport(MobileVLCKit)
true
#else
false
#endif
}
let view = UIView()
var onReady: (() -> Void)?
var onFailure: ((Error) -> Void)?