diff --git a/SJBaseVideoPlayer/Common/Implements/SJFitOnScreenManager.m b/SJBaseVideoPlayer/Common/Implements/SJFitOnScreenManager.m index 4f242f8..2846e6b 100755 --- a/SJBaseVideoPlayer/Common/Implements/SJFitOnScreenManager.m +++ b/SJBaseVideoPlayer/Common/Implements/SJFitOnScreenManager.m @@ -144,12 +144,6 @@ - (void)setFitOnScreen:(BOOL)fitOnScreen animated:(BOOL)animated completionHandl if ( fitOnScreen ) { UIViewController *top = [self topMostController]; if ( !animated ) [self _presentedAnimationWithDuration:0 completionHandler:nil]; - if (@available(iOS 16.0, *)) { - - } else { - // 16以下的系统, 如果当前界面是横屏,fitOn后是竖屏问题 - self.viewController.modalPresentationStyle = UIModalPresentationFullScreen; - } [top presentViewController:self.viewController animated:animated completion:^{ if ( completionHandler ) completionHandler(self); }]; diff --git a/SJBaseVideoPlayer/Common/UIKit/UIViewController+SJBaseVideoPlayerExtended.m b/SJBaseVideoPlayer/Common/UIKit/UIViewController+SJBaseVideoPlayerExtended.m index 0a969f3..61ad74b 100644 --- a/SJBaseVideoPlayer/Common/UIKit/UIViewController+SJBaseVideoPlayerExtended.m +++ b/SJBaseVideoPlayer/Common/UIKit/UIViewController+SJBaseVideoPlayerExtended.m @@ -29,7 +29,13 @@ @implementation SJModalPresentationHandler - (void)setModalViewController:(nullable UIViewController *)modalViewController { _modalViewController = modalViewController; modalViewController.transitioningDelegate = self; - modalViewController.modalPresentationStyle = UIModalPresentationCustom; + if (@available(iOS 16.0, *)) { + modalViewController.modalPresentationStyle = UIModalPresentationCustom; + } else { + // https://github.com/changsanjiang/SJBaseVideoPlayer/pull/36 + // 16以下的系统, 如果当前界面是横屏,fitOn后是竖屏问题 + modalViewController.modalPresentationStyle = UIModalPresentationFullScreen; + } } - (NSTimeInterval)transitionDuration:(nullable id)transitionContext {