fix(ios): handle fullscreen transition cancellation events (#4833)

This commit is contained in:
Kamil Moskała
2026-02-03 00:09:08 +01:00
committed by GitHub
parent 480ddfd715
commit 5c8d73a545
@@ -123,9 +123,16 @@ class VideoComponentViewObserver: NSObject, AVPlayerViewControllerDelegate {
willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator willEndFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
) { ) {
delegate?.willExitFullscreen() delegate?.willExitFullscreen()
coordinator.animate(alongsideTransition: nil) { [weak self] _ in coordinator.animate(alongsideTransition: nil) { [weak self] context in
guard let self = self else { return } guard let self = self else { return }
if context.isCancelled {
self.delegate?.willEnterFullscreen()
return
}
self.delegate?.onFullscreenChange(false) self.delegate?.onFullscreenChange(false)
} }
} }
@@ -135,9 +142,16 @@ class VideoComponentViewObserver: NSObject, AVPlayerViewControllerDelegate {
willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator willBeginFullScreenPresentationWithAnimationCoordinator coordinator: UIViewControllerTransitionCoordinator
) { ) {
delegate?.willEnterFullscreen() delegate?.willEnterFullscreen()
coordinator.animate(alongsideTransition: nil) { [weak self] _ in coordinator.animate(alongsideTransition: nil) { [weak self] context in
guard let self = self else { return } guard let self = self else { return }
if context.isCancelled {
self.delegate?.willExitFullscreen()
return
}
self.delegate?.onFullscreenChange(true) self.delegate?.onFullscreenChange(true)
} }
} }