diff --git a/JustPlayer b/JustPlayer new file mode 160000 index 00000000..3d432407 --- /dev/null +++ b/JustPlayer @@ -0,0 +1 @@ +Subproject commit 3d432407da3665aa0636f131f6801c5bc35c50e3 diff --git a/MPVKit b/MPVKit new file mode 160000 index 00000000..0c01e295 --- /dev/null +++ b/MPVKit @@ -0,0 +1 @@ +Subproject commit 0c01e295f078f8382edcd0bb5326412791084146 diff --git a/composeApp/src/iosMain/kotlin/com/nuvio/app/features/player/PlayerEngine.ios.kt b/composeApp/src/iosMain/kotlin/com/nuvio/app/features/player/PlayerEngine.ios.kt index 83b235c8..1a4d1b67 100644 --- a/composeApp/src/iosMain/kotlin/com/nuvio/app/features/player/PlayerEngine.ios.kt +++ b/composeApp/src/iosMain/kotlin/com/nuvio/app/features/player/PlayerEngine.ios.kt @@ -192,5 +192,6 @@ actual fun PlatformPlayerSurface( UIKitViewController( factory = { bridge.createPlayerViewController() }, modifier = modifier, + interactive = false, ) } diff --git a/iosApp/iosApp/Player/MPVPlayerBridge.swift b/iosApp/iosApp/Player/MPVPlayerBridge.swift index 72292f7e..434b3f8a 100644 --- a/iosApp/iosApp/Player/MPVPlayerBridge.swift +++ b/iosApp/iosApp/Player/MPVPlayerBridge.swift @@ -325,10 +325,9 @@ final class MPVPlayerViewController: UIViewController { func destroyPlayer() { NotificationCenter.default.removeObserver(self) - if let mpv = mpv { - mpv_terminate_destroy(mpv) - } - mpv = nil + guard let ctx = mpv else { return } + mpv = nil // nil first so event loop stops reading + mpv_terminate_destroy(ctx) } // MARK: - State Update @@ -416,8 +415,6 @@ final class MPVPlayerViewController: UIViewController { } } case MPV_EVENT_SHUTDOWN: - mpv_terminate_destroy(mpv) - self.mpv = nil return case MPV_EVENT_LOG_MESSAGE: if let msg = UnsafeMutablePointer(OpaquePointer(eventPtr.pointee.data)) {