Player layout fixes

This commit is contained in:
Arkadiusz Fal
2022-07-09 02:21:04 +02:00
parent 06b7bc79e8
commit 6c71cd72b1
12 changed files with 198 additions and 102 deletions

View File

@@ -33,6 +33,14 @@ final class AVPlayerBackend: PlayerBackend {
avPlayer.timeControlStatus == .playing
}
var aspectRatio: Double {
#if os(tvOS)
VideoPlayerView.defaultAspectRatio
#else
controller?.aspectRatio ?? VideoPlayerView.defaultAspectRatio
#endif
}
var isSeeking: Bool {
// TODO: implement this maybe?
false
@@ -144,14 +152,10 @@ final class AVPlayerBackend: PlayerBackend {
}
func enterFullScreen() {
controller?.playerView
.perform(NSSelectorFromString("enterFullScreenAnimated:completionHandler:"), with: false, with: nil)
model.toggleFullscreen(model?.playingFullScreen ?? false)
}
func exitFullScreen() {
controller?.playerView
.perform(NSSelectorFromString("exitFullScreenAnimated:completionHandler:"), with: false, with: nil)
}
func exitFullScreen() {}
#if os(tvOS)
func closePiP(wasPlaying: Bool) {