mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-30 20:54:45 +00:00
feat: disable interactivity for player view controller and improve player destruction logic
This commit is contained in:
parent
5f3a41bab5
commit
6308a7431d
4 changed files with 6 additions and 6 deletions
1
JustPlayer
Submodule
1
JustPlayer
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3d432407da3665aa0636f131f6801c5bc35c50e3
|
||||
1
MPVKit
Submodule
1
MPVKit
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0c01e295f078f8382edcd0bb5326412791084146
|
||||
|
|
@ -192,5 +192,6 @@ actual fun PlatformPlayerSurface(
|
|||
UIKitViewController(
|
||||
factory = { bridge.createPlayerViewController() },
|
||||
modifier = modifier,
|
||||
interactive = false,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<mpv_event_log_message>(OpaquePointer(eventPtr.pointee.data)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue