fixed force landscape

This commit is contained in:
cranci1 2025-01-31 15:28:06 +01:00
parent fe1d26ab96
commit f5de72c3f0
2 changed files with 16 additions and 16 deletions

View file

@ -17,22 +17,6 @@ class NormalPlayer: AVPlayerViewController {
setupAudioSession()
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if UserDefaults.standard.bool(forKey: "AlwaysLandscape") {
return .landscape
} else {
return .all
}
}
override var prefersHomeIndicatorAutoHidden: Bool {
return true
}
override var prefersStatusBarHidden: Bool {
return true
}
private func setupHoldGesture() {
holdGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleHoldGesture(_:)))
holdGesture?.minimumPressDuration = 0.5

View file

@ -95,4 +95,20 @@ class VideoPlayerViewController: UIViewController {
UserDefaults.standard.set(duration, forKey: "totalTime_\(fullURL)")
}
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if UserDefaults.standard.bool(forKey: "AlwaysLandscape") {
return .landscape
} else {
return .all
}
}
override var prefersHomeIndicatorAutoHidden: Bool {
return true
}
override var prefersStatusBarHidden: Bool {
return true
}
}