ZFLandscapeViewController+RQExtension.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // ZFLandscapeViewController+RQExtension.m
  3. // JSJP
  4. //
  5. // Created by 张嵘 on 2021/11/26.
  6. //
  7. #import "ZFLandscapeViewController+RQExtension.h"
  8. #import<StoreKit/StoreKit.h>
  9. @implementation ZFLandscapeViewController (RQExtension)
  10. - (void)viewWillAppear:(BOOL)animated {
  11. [super viewWillAppear:animated];
  12. RQ_Video_Module.playerController.viewControllerDisappear = NO;
  13. if (RQ_Video_Module.playerController.player.isFullScreen && RQ_Video_Module.playerController.player.currentPlayerManager.playState == ZFPlayerPlayStatePaused) {
  14. [RQ_Video_Module.playerController.player.currentPlayerManager play];
  15. }
  16. }
  17. - (void)viewWillDisappear:(BOOL)animated {
  18. [super viewWillDisappear:animated];
  19. RQ_Video_Module.playerController.viewControllerDisappear = YES;
  20. }
  21. - (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  22. UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
  23. if (RQ_Video_Module.playerController.player.isFullScreen && UIInterfaceOrientationIsLandscape(currentOrientation)) {
  24. return UIInterfaceOrientationMaskLandscape;
  25. }
  26. return UIInterfaceOrientationMaskAll;
  27. }
  28. - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
  29. if (RQ_Video_Module.playerController.player.isFullScreen) {
  30. return UIInterfaceOrientationLandscapeRight;
  31. }
  32. return UIInterfaceOrientationPortrait;
  33. }
  34. @end