Guard Native Playback Availability

Dreamio now checks whether the MobileVLCKit-backed native player is actually linked before presenting the full-screen native player. Raw project builds stay buildable, but they now show a setup alert instead of opening a black player that can only fail.

Beads: dreamio-2k5 Native playback CocoaPods setup 2026-05-25

Summary

Fixed the unavailable native playback build path by exposing a build-time availability check on VLCNativePlaybackBackend and using it before Dreamio presents native playback. CocoaPods was installed through Homebrew, pod install was run, and the generated workspace now links MobileVLCKit.

Changes Made

Context

The repository has a Podfile declaring MobileVLCKit, but this checkout did not have a generated Pods/ directory or Dreamio.xcworkspace. In that state, Swift takes the fallback compile path where canImport(MobileVLCKit) is false. Before this change, Dreamio could still present the native player, which then displayed the generic fallback error.

Important Implementation Details

Relevant Diff Snippets

@pierre/diffs is installed as a library dependency, but its package does not expose a runnable CLI in this checkout, and npx @pierre/diffs --help failed with "could not determine executable to run." The plain diff below is the fallback snippet for the core behavior change.

diff --git a/Dreamio/DreamioWebViewController.swift b/Dreamio/DreamioWebViewController.swift
@@ -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)

diff --git a/Dreamio/VLCNativePlaybackBackend.swift b/Dreamio/VLCNativePlaybackBackend.swift
@@ -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)?

Expected Impact for End-Users

Users who accidentally run a raw .xcodeproj build will see a clear CocoaPods setup message instead of a black native player with an unavailable-build failure. Users who build from Dreamio.xcworkspace with MobileVLCKit linked should continue into VLC-backed direct-file playback.

Validation

Issues, Limitations, and Mitigations

The simulator workspace build passes. Real-device playback validation is still required for the actual VLC-backed stream behavior.

Follow-up Work