Attempt to fix orientation lock on iOS 16

This commit is contained in:
Arkadiusz Fal
2022-11-11 14:25:56 +01:00
parent a3ba1cb6df
commit 99e20f54a2
2 changed files with 8 additions and 4 deletions

View File

@@ -342,7 +342,10 @@ struct PlayerControls: View {
if player.lockedOrientation.isNil {
let orientationMask = OrientationTracker.shared.currentInterfaceOrientationMask
player.lockedOrientation = orientationMask
Orientation.lockOrientation(orientationMask)
let orientation = OrientationTracker.shared.currentInterfaceOrientation
Orientation.lockOrientation(orientationMask, andRotateTo: .landscapeLeft)
// iOS 16 workaround
Orientation.lockOrientation(orientationMask, andRotateTo: orientation)
} else {
player.lockedOrientation = nil
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)