瀏覽代碼

VLCMovieViewController: Fix orientation detection for notches

The orientation should be detected through UIInterfaceOrientation and
not UIDeviceOrientation in order to avoid specifically handling
orientation such as UIDeviceOrientationFaceUp.
Soomin Lee 5 年之前
父節點
當前提交
ae5578cada
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Sources/VLCMovieViewController.m

+ 3 - 3
Sources/VLCMovieViewController.m

@@ -1791,10 +1791,10 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
     // 30.0 represents the exact size of the notch
     CGFloat constant = _vpc.currentAspectRatio != VLCAspectRatioFillToScreen ? 30.0 : 0.0;
 
-    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
+    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
 
-    if (orientation == UIDeviceOrientationLandscapeLeft
-        || orientation == UIDeviceOrientationLandscapeRight) {
+    if (orientation == UIInterfaceOrientationLandscapeLeft
+        || orientation == UIInterfaceOrientationLandscapeRight) {
         [_movieViewLeadingConstraint setConstant:constant];
         [_movieViewTrailingConstraint setConstant:-constant];
     } else {