From 7def3ac38772ab2ec181a2e60735c407aad6378b Mon Sep 17 00:00:00 2001 From: YangJH Date: Thu, 4 Jul 2024 19:46:42 +0900 Subject: [PATCH] fix(ios): fix fullscreen view controller ANR (#3952) - ANR occurred setFullscreen(true) when view controller presenting --- ios/Video/RCTVideo.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index f1b53a58..e8c91d84 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -968,7 +968,8 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH @objc func setFullscreen(_ fullscreen: Bool) { - if fullscreen && !_fullscreenPlayerPresented && _player != nil { + var alreadyFullscreenPresented = _presentingViewController?.presentedViewController != nil + if fullscreen && !_fullscreenPlayerPresented && _player != nil && !alreadyFullscreenPresented { // Ensure player view controller is not null // Controls will be displayed even if it is disabled in configuration if _playerViewController == nil {