mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
parent
cf30ca7d31
commit
b220f212df
@ -502,7 +502,7 @@ final class MPVBackend: PlayerBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func didChangeTo() {
|
func didChangeTo() {
|
||||||
setNeedsDrawing(true)
|
setNeedsDrawing(model.presentingPlayer)
|
||||||
|
|
||||||
if model.musicMode {
|
if model.musicMode {
|
||||||
startMusicMode()
|
startMusicMode()
|
||||||
|
@ -249,7 +249,6 @@ final class PlayerModel: ObservableObject {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
presentingPlayer = true
|
presentingPlayer = true
|
||||||
setNeedsDrawing(true)
|
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
Windows.player.open()
|
Windows.player.open()
|
||||||
@ -505,7 +504,10 @@ final class PlayerModel: ObservableObject {
|
|||||||
}
|
}
|
||||||
#endif
|
#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()
|
controls.hide()
|
||||||
|
|
||||||
|
@ -89,7 +89,6 @@ extension VideoPlayerView {
|
|||||||
withAnimation(Constants.overlayAnimation) {
|
withAnimation(Constants.overlayAnimation) {
|
||||||
viewDragOffset = Self.hiddenOffset
|
viewDragOffset = Self.hiddenOffset
|
||||||
}
|
}
|
||||||
player.backend.setNeedsDrawing(false)
|
|
||||||
} else {
|
} else {
|
||||||
withAnimation(Constants.overlayAnimation) {
|
withAnimation(Constants.overlayAnimation) {
|
||||||
viewDragOffset = 0
|
viewDragOffset = 0
|
||||||
|
@ -126,6 +126,9 @@ struct VideoPlayerView: View {
|
|||||||
.onChange(of: geometry.size) { size in
|
.onChange(of: geometry.size) { size in
|
||||||
self.playerSize = size
|
self.playerSize = size
|
||||||
}
|
}
|
||||||
|
.onChange(of: fullScreenDetails) { value in
|
||||||
|
player.backend.setNeedsDrawing(!value)
|
||||||
|
}
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!))
|
.frame(width: playerWidth.isNil ? nil : Double(playerWidth!), height: playerHeight.isNil ? nil : Double(playerHeight!))
|
||||||
.ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea)
|
.ignoresSafeArea(.all, edges: playerEdgesIgnoringSafeArea)
|
||||||
|
Loading…
Reference in New Issue
Block a user