Revert "Fix drawing state issues"

This reverts commit 97149df71c.
This commit is contained in:
Arkadiusz Fal 2022-08-31 21:20:12 +02:00
parent cf30ca7d31
commit b220f212df
4 changed files with 8 additions and 4 deletions

View File

@ -502,7 +502,7 @@ final class MPVBackend: PlayerBackend {
}
func didChangeTo() {
setNeedsDrawing(true)
setNeedsDrawing(model.presentingPlayer)
if model.musicMode {
startMusicMode()

View File

@ -249,7 +249,6 @@ final class PlayerModel: ObservableObject {
#endif
presentingPlayer = true
setNeedsDrawing(true)
#if os(macOS)
Windows.player.open()
@ -505,7 +504,10 @@ final class PlayerModel: ObservableObject {
}
#endif
backend.setNeedsDrawing(presentingPlayer)
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in
guard let self = self else { return }
self.backend.setNeedsDrawing(self.presentingPlayer)
}
controls.hide()

View File

@ -89,7 +89,6 @@ extension VideoPlayerView {
withAnimation(Constants.overlayAnimation) {
viewDragOffset = Self.hiddenOffset
}
player.backend.setNeedsDrawing(false)
} else {
withAnimation(Constants.overlayAnimation) {
viewDragOffset = 0

View File

@ -126,6 +126,9 @@ struct VideoPlayerView: View {
.onChange(of: geometry.size) { size in
self.playerSize = size
}
.onChange(of: fullScreenDetails) { value in
player.backend.setNeedsDrawing(!value)
}
#if os(iOS)
.frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!))
.ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea)