mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 08:32:00 +00:00
fixed force landscape
This commit is contained in:
parent
fe1d26ab96
commit
f5de72c3f0
2 changed files with 16 additions and 16 deletions
|
|
@ -17,22 +17,6 @@ class NormalPlayer: AVPlayerViewController {
|
||||||
setupAudioSession()
|
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() {
|
private func setupHoldGesture() {
|
||||||
holdGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleHoldGesture(_:)))
|
holdGesture = UILongPressGestureRecognizer(target: self, action: #selector(handleHoldGesture(_:)))
|
||||||
holdGesture?.minimumPressDuration = 0.5
|
holdGesture?.minimumPressDuration = 0.5
|
||||||
|
|
|
||||||
|
|
@ -95,4 +95,20 @@ class VideoPlayerViewController: UIViewController {
|
||||||
UserDefaults.standard.set(duration, forKey: "totalTime_\(fullURL)")
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue