Fullscreen handling changes

This commit is contained in:
Arkadiusz Fal
2022-04-03 14:23:42 +02:00
parent 76df80578d
commit 9edcf66557
6 changed files with 66 additions and 53 deletions

View File

@@ -88,26 +88,6 @@ final class PlayerControlsModel: ObservableObject {
}
}
func toggleFullscreen(_ value: Bool) {
withAnimation(Animation.easeOut) {
resetTimer()
withAnimation(PlayerControls.animation) {
playingFullscreen = !value
}
#if os(iOS)
if playingFullscreen {
guard !(UIApplication.shared.windows.first?.windowScene?.interfaceOrientation.isLandscape ?? true) else {
return
}
Orientation.lockOrientation(.landscape, andRotateTo: .landscapeRight)
} else {
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
}
#endif
}
}
func reset() {
currentTime = .zero
duration = .zero