// // ZFLandscapeViewController+RQExtension.m // SDJK // // Created by 张嵘 on 2021/11/26. // #import "ZFLandscapeViewController+RQExtension.h" #import @interface ZFLandscapeViewController (RQExtension) @end @implementation ZFLandscapeViewController (RQExtension) //- (void)viewWillAppear:(BOOL)animated { // [super viewWillAppear:animated]; // RQ_Video_Module.playerController.viewControllerDisappear = NO; // if (RQ_Video_Module.playerController.player.isFullScreen && RQ_Video_Module.playerController.player.currentPlayerManager.playState == ZFPlayerPlayStatePaused) { // [RQ_Video_Module.playerController.player.currentPlayerManager play]; // } //} // //- (void)viewWillDisappear:(BOOL)animated { // [super viewWillDisappear:animated]; // RQ_Video_Module.playerController.viewControllerDisappear = YES; //} // //- (UIInterfaceOrientationMask)supportedInterfaceOrientations { // UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation; // if (RQ_Video_Module.playerController.player.isFullScreen && UIInterfaceOrientationIsLandscape(currentOrientation)) { // return UIInterfaceOrientationMaskLandscape; // } // return UIInterfaceOrientationMaskAll; //} // //- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { // if (RQ_Video_Module.playerController.player.isFullScreen) { // return UIInterfaceOrientationLandscapeRight; // } // return UIInterfaceOrientationPortrait; //} //- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { //// self.rotating = YES; // [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; // if (!UIDeviceOrientationIsValidInterfaceOrientation([UIDevice currentDevice].orientation)) { // return; // } // UIInterfaceOrientation newOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation; // UIInterfaceOrientation oldOrientation = self.currentOrientation; // if (UIInterfaceOrientationIsLandscape(newOrientation)) { // if (self.contentView.superview != self.view) { // [self.view addSubview:self.contentView]; // } // } // // if (oldOrientation == UIInterfaceOrientationPortrait) { // self.contentView.frame = [self.delegate ls_targetRect]; // [self.contentView layoutIfNeeded]; // } // self.currentOrientation = newOrientation; // // [self.delegate ls_willRotateToOrientation:self.currentOrientation]; // BOOL isFullscreen = size.width > size.height; // if (self.disableAnimations) { // [CATransaction begin]; // [CATransaction setDisableActions:YES]; // } // // [coordinator animateAlongsideTransition:^(id _Nonnull context) { // if (isFullscreen) { // self.contentView.frame = CGRectMake(0, 0, size.width, size.height); // } else { // self.contentView.frame = [self.delegate ls_targetRect]; // } // [self.contentView layoutIfNeeded]; // if (@available(iOS 15.0, *)) { // CGFloat duration = [coordinator transitionDuration]; // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ // [CATransaction commit]; // }); // } // } completion:^(id _Nonnull context) { // if (@available(iOS 15.0, *)) { // } else { // [CATransaction commit]; // } // self.disableAnimations = NO; // [self.delegate ls_didRotateFromOrientation:self.currentOrientation]; //// self.rotating = NO; // }]; //} @end