Minor fixes

This commit is contained in:
Arkadiusz Fal
2022-09-01 00:41:31 +02:00
parent f5016cc961
commit b8380b2528
13 changed files with 49 additions and 41 deletions

View File

@@ -129,7 +129,7 @@ final class MPVBackend: PlayerBackend {
) {
self.model = model
self.controls = controls
self.playerTime = playerTime ?? PlayerTimeModel.shared
self.playerTime = playerTime ?? PlayerTimeModel.shared
self.networkState = networkState
clientTimer = .init(interval: .seconds(Self.timeUpdateInterval), mode: .infinite) { [weak self] _ in

View File

@@ -274,7 +274,7 @@ final class MPVClient: ObservableObject {
let height = [self.backend.model.playerSize.height, self.backend.model.playerSize.width / aspectRatio].min()!
var insets = 0.0
#if os(iOS)
insets = OrientationTracker.shared.currentInterfaceOrientation.isPortrait ? SafeArea.insets.bottom : 0
insets = OrientationTracker.shared.currentInterfaceOrientation.isPortrait ? SafeArea.insets.bottom : 0
#endif
let offsetY = self.backend.model.playingFullScreen ? ((self.backend.model.playerSize.height / 2.0) - ((height + insets) / 2)) : 0
self.glView?.frame = CGRect(x: 0, y: offsetY, width: roundedWidth, height: height)