diff --git a/Model/Player/Backends/MPVBackend.swift b/Model/Player/Backends/MPVBackend.swift index c89daa1c..77262407 100644 --- a/Model/Player/Backends/MPVBackend.swift +++ b/Model/Player/Backends/MPVBackend.swift @@ -502,7 +502,7 @@ final class MPVBackend: PlayerBackend { } func didChangeTo() { - setNeedsDrawing(model.presentingPlayer) + setNeedsDrawing(true) if model.musicMode { startMusicMode() diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index dcfc0c80..54881a09 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -249,6 +249,7 @@ final class PlayerModel: ObservableObject { #endif presentingPlayer = true + setNeedsDrawing(true) #if os(macOS) Windows.player.open() @@ -504,10 +505,7 @@ final class PlayerModel: ObservableObject { } #endif - DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in - guard let self = self else { return } - self.backend.setNeedsDrawing(self.presentingPlayer) - } + backend.setNeedsDrawing(presentingPlayer) controls.hide() diff --git a/Shared/Player/PlayerDragGesture.swift b/Shared/Player/PlayerDragGesture.swift index fb19bdaa..43419915 100644 --- a/Shared/Player/PlayerDragGesture.swift +++ b/Shared/Player/PlayerDragGesture.swift @@ -89,6 +89,7 @@ extension VideoPlayerView { withAnimation(Constants.overlayAnimation) { viewDragOffset = Self.hiddenOffset } + player.backend.setNeedsDrawing(false) } else { withAnimation(Constants.overlayAnimation) { viewDragOffset = 0 diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 54a65275..8fe65332 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -126,9 +126,6 @@ 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)