mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
Fix background playback setting behavior across platforms
Hide the toggle on macOS, where apps are never suspended and playback always continues regardless of the setting. Pause playback on iOS when backgrounding with the setting disabled — the audio background mode previously kept mpv playing, making the off state a no-op. Move the continue-playing policy into PlayerService and make the backend's background render pause unconditional (PiP-gated only): it is a GPU optimization that should not depend on the setting. Also ungate the player sheet visibility handlers, which manage foreground mini player rendering unrelated to background playback.
This commit is contained in:
@@ -998,7 +998,7 @@ final class MPVBackend: PlayerBackend {
|
||||
|
||||
// MARK: - Background Playback
|
||||
|
||||
func handleScenePhase(_ phase: ScenePhase, backgroundEnabled: Bool, isPiPActive: Bool) {
|
||||
func handleScenePhase(_ phase: ScenePhase, isPiPActive: Bool) {
|
||||
#if os(iOS)
|
||||
let pipActive = self.isPiPActive || isPiPActive
|
||||
#else
|
||||
@@ -1008,8 +1008,8 @@ final class MPVBackend: PlayerBackend {
|
||||
MPVLogging.logAppLifecycle("handleScenePhase(\(phase))",
|
||||
isPiPActive: pipActive, isRendering: nil)
|
||||
|
||||
guard backgroundEnabled, !pipActive else {
|
||||
MPVLogging.log("handleScenePhase: skipping (bgEnabled:\(backgroundEnabled) pip:\(pipActive))")
|
||||
guard !pipActive else {
|
||||
MPVLogging.log("handleScenePhase: skipping (pip:\(pipActive))")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user