Add "Pause when entering background" option (#198)

This commit is contained in:
Arkadiusz Fal
2022-06-30 11:46:20 +02:00
parent 979e3cae8f
commit 23075751c3
3 changed files with 16 additions and 2 deletions

View File

@@ -522,7 +522,7 @@ final class PlayerModel: ObservableObject {
}
#else
func handleEnterForeground() {
setNeedsDrawing(true)
setNeedsDrawing(presentingPlayer)
guard closePiPAndOpenPlayerOnEnteringForeground, playingInPictureInPicture else {
return
@@ -534,7 +534,8 @@ final class PlayerModel: ObservableObject {
func handleEnterBackground() {
setNeedsDrawing(false)
if !playingInPictureInPicture, !musicMode {
if Defaults[.pauseOnEnteringBackground], !playingInPictureInPicture, !musicMode {
pause()
}
}