Fix orientation issues

This commit is contained in:
Arkadiusz Fal
2022-11-13 13:15:44 +01:00
parent 0049a68839
commit fe9b7c03ca
2 changed files with 14 additions and 4 deletions

View File

@@ -7,11 +7,13 @@ extension VideoPlayerView {
let currentOrientation = OrientationTracker.shared.currentInterfaceOrientation
if currentOrientation.isLandscape,
Defaults[.enterFullscreenInLandscape],
!Defaults[.honorSystemOrientationLock],
!player.playingFullScreen,
!player.playingInPictureInPicture
!player.currentItem.isNil,
player.lockedOrientation.isNil || player.lockedOrientation!.contains(.landscape),
!player.playingInPictureInPicture,
player.presentingPlayer
{
guard player.presentingPlayer else { return }
DispatchQueue.main.async {
player.controls.presentingControls = false
player.enterFullScreen(showControls: false)