mirror of
https://github.com/yattee/yattee.git
synced 2025-01-05 04:17:02 +00:00
Merge pull request #793 from stonerl/mpv-remove-video-layer
mpv: remove video layer when entering background
This commit is contained in:
commit
4d02538cb9
@ -979,7 +979,11 @@ final class PlayerModel: ObservableObject {
|
|||||||
func handleEnterForeground() {
|
func handleEnterForeground() {
|
||||||
setNeedsDrawing(presentingPlayer)
|
setNeedsDrawing(presentingPlayer)
|
||||||
|
|
||||||
if !musicMode, activeBackend == .appleAVPlayer {
|
if !musicMode, activeBackend == .mpv {
|
||||||
|
mpvBackend.addVideoTrackFromStream()
|
||||||
|
mpvBackend.setVideoToAuto()
|
||||||
|
mpvBackend.controls.resetTimer()
|
||||||
|
} else if !musicMode, activeBackend == .appleAVPlayer {
|
||||||
avPlayerBackend.bindPlayerToLayer()
|
avPlayerBackend.bindPlayerToLayer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1005,8 +1009,10 @@ final class PlayerModel: ObservableObject {
|
|||||||
func handleEnterBackground() {
|
func handleEnterBackground() {
|
||||||
if Defaults[.pauseOnEnteringBackground], !playingInPictureInPicture, !musicMode {
|
if Defaults[.pauseOnEnteringBackground], !playingInPictureInPicture, !musicMode {
|
||||||
pause()
|
pause()
|
||||||
} else if !playingInPictureInPicture {
|
} else if !playingInPictureInPicture, activeBackend == .appleAVPlayer {
|
||||||
avPlayerBackend.removePlayerFromLayer()
|
avPlayerBackend.removePlayerFromLayer()
|
||||||
|
} else if activeBackend == .mpv, !musicMode {
|
||||||
|
mpvBackend.setVideoToNo()
|
||||||
}
|
}
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
guard playingFullScreen else { return }
|
guard playingFullScreen else { return }
|
||||||
|
Loading…
Reference in New Issue
Block a user