mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 14:03:41 +00:00
Aspect ratio fixes
This commit is contained in:
parent
79f801ea60
commit
d3336b3ae1
@ -318,7 +318,7 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
return
|
||||
}
|
||||
|
||||
self.model.aspectRatio = self.aspectRatio
|
||||
self.updatePlayerAspectRatio()
|
||||
|
||||
if !preservingTime,
|
||||
let segment = self.model.sponsorBlock.segments.first,
|
||||
|
@ -45,6 +45,7 @@ final class MPVBackend: PlayerBackend {
|
||||
networkStateTimer.start()
|
||||
|
||||
if isPlaying {
|
||||
self.updatePlayerAspectRatio()
|
||||
startClientUpdates()
|
||||
} else {
|
||||
stopControlsUpdates()
|
||||
@ -204,11 +205,9 @@ final class MPVBackend: PlayerBackend {
|
||||
|
||||
self.model.lastSkipped = segment
|
||||
self.play()
|
||||
self.model.aspectRatio = self.aspectRatio
|
||||
}
|
||||
} else {
|
||||
self.play()
|
||||
self.model.aspectRatio = self.aspectRatio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,4 +98,10 @@ extension PlayerBackend {
|
||||
model.advanceToItem(item)
|
||||
}
|
||||
}
|
||||
|
||||
func updatePlayerAspectRatio() {
|
||||
DispatchQueue.main.async {
|
||||
self.model.aspectRatio = aspectRatio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -300,15 +300,10 @@ struct VideoPlayerView: View {
|
||||
}
|
||||
.overlay(GeometryReader { proxy in
|
||||
Color.clear
|
||||
.onAppear {
|
||||
player.playerSize = proxy.size
|
||||
}
|
||||
.onChange(of: proxy.size) { _ in
|
||||
player.playerSize = proxy.size
|
||||
}
|
||||
.onChange(of: player.controls.presentingOverlays) { _ in
|
||||
player.playerSize = proxy.size
|
||||
}
|
||||
.onAppear { player.playerSize = proxy.size }
|
||||
.onChange(of: proxy.size) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.controls.presentingOverlays) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.aspectRatio) { _ in player.playerSize = proxy.size }
|
||||
})
|
||||
#if os(iOS)
|
||||
.padding(.top, player.playingFullScreen && verticalSizeClass == .regular ? 20 : 0)
|
||||
|
Loading…
Reference in New Issue
Block a user