// // ZFLandscapeViewController+RQExtension.m // JSJP // // Created by 张嵘 on 2021/11/26. // #import "ZFLandscapeViewController+RQExtension.h" #import @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; } @end