mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Remove "Rotate to portrait when exiting fullscreen" setting
Now it is automatically decided depending on device type
This commit is contained in:
parent
0dee8310ce
commit
e1f03bc025
@ -127,7 +127,6 @@ final class PlayerModel: ObservableObject {
|
|||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@Published var lockedOrientation: UIInterfaceOrientationMask?
|
@Published var lockedOrientation: UIInterfaceOrientationMask?
|
||||||
@Default(.rotateToPortraitOnExitFullScreen) private var rotateToPortraitOnExitFullScreen
|
|
||||||
@Default(.rotateToLandscapeOnEnterFullScreen) private var rotateToLandscapeOnEnterFullScreen
|
@Default(.rotateToLandscapeOnEnterFullScreen) private var rotateToLandscapeOnEnterFullScreen
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1041,7 +1040,7 @@ final class PlayerModel: ObservableObject {
|
|||||||
avPlayerBackend.controller.dismiss(animated: true)
|
avPlayerBackend.controller.dismiss(animated: true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let rotationOrientation = rotateToPortraitOnExitFullScreen ? UIInterfaceOrientation.portrait : nil
|
let rotationOrientation = Constants.isIPhone ? UIInterfaceOrientation.portrait : nil
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: rotationOrientation)
|
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: rotationOrientation)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,7 +190,6 @@ extension Defaults.Keys {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
static let honorSystemOrientationLock = Key<Bool>("honorSystemOrientationLock", default: true)
|
static let honorSystemOrientationLock = Key<Bool>("honorSystemOrientationLock", default: true)
|
||||||
static let enterFullscreenInLandscape = Key<Bool>("enterFullscreenInLandscape", default: UIDevice.current.userInterfaceIdiom == .phone)
|
static let enterFullscreenInLandscape = Key<Bool>("enterFullscreenInLandscape", default: UIDevice.current.userInterfaceIdiom == .phone)
|
||||||
static let rotateToPortraitOnExitFullScreen = Key<Bool>("rotateToPortraitOnExitFullScreen", default: UIDevice.current.userInterfaceIdiom == .phone)
|
|
||||||
static let rotateToLandscapeOnEnterFullScreen = Key<FullScreenRotationSetting>(
|
static let rotateToLandscapeOnEnterFullScreen = Key<FullScreenRotationSetting>(
|
||||||
"rotateToLandscapeOnEnterFullScreen",
|
"rotateToLandscapeOnEnterFullScreen",
|
||||||
default: UIDevice.current.userInterfaceIdiom == .phone ? .landscapeRight : .disabled
|
default: UIDevice.current.userInterfaceIdiom == .phone ? .landscapeRight : .disabled
|
||||||
|
@ -42,7 +42,7 @@ import SwiftUI
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
self.player.lockedOrientation = nil
|
self.player.lockedOrientation = nil
|
||||||
|
|
||||||
if Defaults[.rotateToPortraitOnExitFullScreen] {
|
if Constants.isIPhone {
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
|
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ extension VideoPlayerView {
|
|||||||
{
|
{
|
||||||
player.exitFullScreen(showControls: false)
|
player.exitFullScreen(showControls: false)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
if Defaults[.rotateToPortraitOnExitFullScreen] {
|
if Constants.isIPhone {
|
||||||
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
|
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,7 +17,6 @@ struct PlayerSettings: View {
|
|||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
@Default(.honorSystemOrientationLock) private var honorSystemOrientationLock
|
@Default(.honorSystemOrientationLock) private var honorSystemOrientationLock
|
||||||
@Default(.enterFullscreenInLandscape) private var enterFullscreenInLandscape
|
@Default(.enterFullscreenInLandscape) private var enterFullscreenInLandscape
|
||||||
@Default(.rotateToPortraitOnExitFullScreen) private var rotateToPortraitOnExitFullScreen
|
|
||||||
@Default(.rotateToLandscapeOnEnterFullScreen) private var rotateToLandscapeOnEnterFullScreen
|
@Default(.rotateToLandscapeOnEnterFullScreen) private var rotateToLandscapeOnEnterFullScreen
|
||||||
#endif
|
#endif
|
||||||
@Default(.closePiPOnNavigation) private var closePiPOnNavigation
|
@Default(.closePiPOnNavigation) private var closePiPOnNavigation
|
||||||
@ -122,7 +121,6 @@ struct PlayerSettings: View {
|
|||||||
enterFullscreenInLandscapeToggle
|
enterFullscreenInLandscapeToggle
|
||||||
}
|
}
|
||||||
honorSystemOrientationLockToggle
|
honorSystemOrientationLockToggle
|
||||||
rotateToPortraitOnExitFullScreenToggle
|
|
||||||
rotateToLandscapeOnEnterFullScreenPicker
|
rotateToLandscapeOnEnterFullScreenPicker
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -214,10 +212,6 @@ struct PlayerSettings: View {
|
|||||||
Toggle("Enter fullscreen in landscape", isOn: $enterFullscreenInLandscape)
|
Toggle("Enter fullscreen in landscape", isOn: $enterFullscreenInLandscape)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var rotateToPortraitOnExitFullScreenToggle: some View {
|
|
||||||
Toggle("Rotate to portrait when exiting fullscreen", isOn: $rotateToPortraitOnExitFullScreen)
|
|
||||||
}
|
|
||||||
|
|
||||||
private var rotateToLandscapeOnEnterFullScreenPicker: some View {
|
private var rotateToLandscapeOnEnterFullScreenPicker: some View {
|
||||||
Picker("Rotate when entering fullscreen on landscape video", selection: $rotateToLandscapeOnEnterFullScreen) {
|
Picker("Rotate when entering fullscreen on landscape video", selection: $rotateToLandscapeOnEnterFullScreen) {
|
||||||
Text("Landscape left").tag(FullScreenRotationSetting.landscapeRight)
|
Text("Landscape left").tag(FullScreenRotationSetting.landscapeRight)
|
||||||
|
Loading…
Reference in New Issue
Block a user