mirror of
https://github.com/yattee/yattee.git
synced 2024-12-12 21:30:32 +05:30
mpv: remove video layer when entering background
- fixes #792 Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
parent
2d7a101ce0
commit
98f5b1a22b
@ -979,7 +979,11 @@ final class PlayerModel: ObservableObject {
|
||||
func handleEnterForeground() {
|
||||
setNeedsDrawing(presentingPlayer)
|
||||
|
||||
if !musicMode, activeBackend == .appleAVPlayer {
|
||||
if !musicMode, activeBackend == .mpv {
|
||||
mpvBackend.addVideoTrackFromStream()
|
||||
mpvBackend.setVideoToAuto()
|
||||
mpvBackend.controls.resetTimer()
|
||||
} else if !musicMode, activeBackend == .appleAVPlayer {
|
||||
avPlayerBackend.bindPlayerToLayer()
|
||||
}
|
||||
|
||||
@ -1005,8 +1009,10 @@ final class PlayerModel: ObservableObject {
|
||||
func handleEnterBackground() {
|
||||
if Defaults[.pauseOnEnteringBackground], !playingInPictureInPicture, !musicMode {
|
||||
pause()
|
||||
} else if !playingInPictureInPicture {
|
||||
} else if !playingInPictureInPicture, activeBackend == .appleAVPlayer {
|
||||
avPlayerBackend.removePlayerFromLayer()
|
||||
} else if activeBackend == .mpv, !musicMode {
|
||||
mpvBackend.setVideoToNo()
|
||||
}
|
||||
#if os(iOS)
|
||||
guard playingFullScreen else { return }
|
||||
|
Loading…
Reference in New Issue
Block a user