Rotation fixes

This commit is contained in:
Arkadiusz Fal
2023-05-21 19:11:11 +02:00
parent d7a2564617
commit d996069a20
2 changed files with 19 additions and 3 deletions

View File

@@ -1023,6 +1023,7 @@ final class PlayerModel: ObservableObject {
if playingFullScreen {
if activeBackend == .appleAVPlayer, avPlayerUsesSystemControls {
avPlayerBackend.controller.enterFullScreen(animated: true)
return
}
guard rotateToLandscapeOnEnterFullScreen.isRotating else { return }
if currentVideoIsLandscape {
@@ -1038,6 +1039,7 @@ final class PlayerModel: ObservableObject {
if activeBackend == .appleAVPlayer, avPlayerUsesSystemControls {
avPlayerBackend.controller.exitFullScreen(animated: true)
avPlayerBackend.controller.dismiss(animated: true)
return
}
let rotationOrientation = rotateToPortraitOnExitFullScreen ? UIInterfaceOrientation.portrait : nil
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: rotationOrientation)