ZFLandscapeViewController+RQExtension.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // ZFLandscapeViewController+RQExtension.m
  3. // SDJK
  4. //
  5. // Created by 张嵘 on 2021/11/26.
  6. //
  7. #import "ZFLandscapeViewController+RQExtension.h"
  8. #import<StoreKit/StoreKit.h>
  9. @interface ZFLandscapeViewController (RQExtension)
  10. @end
  11. @implementation ZFLandscapeViewController (RQExtension)
  12. //- (void)viewWillAppear:(BOOL)animated {
  13. // [super viewWillAppear:animated];
  14. // RQ_Video_Module.playerController.viewControllerDisappear = NO;
  15. // if (RQ_Video_Module.playerController.player.isFullScreen && RQ_Video_Module.playerController.player.currentPlayerManager.playState == ZFPlayerPlayStatePaused) {
  16. // [RQ_Video_Module.playerController.player.currentPlayerManager play];
  17. // }
  18. //}
  19. //
  20. //- (void)viewWillDisappear:(BOOL)animated {
  21. // [super viewWillDisappear:animated];
  22. // RQ_Video_Module.playerController.viewControllerDisappear = YES;
  23. //}
  24. //
  25. //- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
  26. // UIInterfaceOrientation currentOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
  27. // if (RQ_Video_Module.playerController.player.isFullScreen && UIInterfaceOrientationIsLandscape(currentOrientation)) {
  28. // return UIInterfaceOrientationMaskLandscape;
  29. // }
  30. // return UIInterfaceOrientationMaskAll;
  31. //}
  32. //
  33. //- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
  34. // if (RQ_Video_Module.playerController.player.isFullScreen) {
  35. // return UIInterfaceOrientationLandscapeRight;
  36. // }
  37. // return UIInterfaceOrientationPortrait;
  38. //}
  39. //- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
  40. //// self.rotating = YES;
  41. // [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
  42. // if (!UIDeviceOrientationIsValidInterfaceOrientation([UIDevice currentDevice].orientation)) {
  43. // return;
  44. // }
  45. // UIInterfaceOrientation newOrientation = (UIInterfaceOrientation)[UIDevice currentDevice].orientation;
  46. // UIInterfaceOrientation oldOrientation = self.currentOrientation;
  47. // if (UIInterfaceOrientationIsLandscape(newOrientation)) {
  48. // if (self.contentView.superview != self.view) {
  49. // [self.view addSubview:self.contentView];
  50. // }
  51. // }
  52. //
  53. // if (oldOrientation == UIInterfaceOrientationPortrait) {
  54. // self.contentView.frame = [self.delegate ls_targetRect];
  55. // [self.contentView layoutIfNeeded];
  56. // }
  57. // self.currentOrientation = newOrientation;
  58. //
  59. // [self.delegate ls_willRotateToOrientation:self.currentOrientation];
  60. // BOOL isFullscreen = size.width > size.height;
  61. // if (self.disableAnimations) {
  62. // [CATransaction begin];
  63. // [CATransaction setDisableActions:YES];
  64. // }
  65. //
  66. // [coordinator animateAlongsideTransition:^(id _Nonnull context) {
  67. // if (isFullscreen) {
  68. // self.contentView.frame = CGRectMake(0, 0, size.width, size.height);
  69. // } else {
  70. // self.contentView.frame = [self.delegate ls_targetRect];
  71. // }
  72. // [self.contentView layoutIfNeeded];
  73. // if (@available(iOS 15.0, *)) {
  74. // CGFloat duration = [coordinator transitionDuration];
  75. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  76. // [CATransaction commit];
  77. // });
  78. // }
  79. // } completion:^(id _Nonnull context) {
  80. // if (@available(iOS 15.0, *)) {
  81. // } else {
  82. // [CATransaction commit];
  83. // }
  84. // self.disableAnimations = NO;
  85. // [self.delegate ls_didRotateFromOrientation:self.currentOrientation];
  86. //// self.rotating = NO;
  87. // }];
  88. //}
  89. @end