mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 14:22:02 +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:
@@ -146,7 +146,7 @@ struct MPVVideoView: View {
|
||||
#if os(iOS) || os(macOS)
|
||||
// Resume the MPV display link when the expanded video view appears.
|
||||
// MiniPlayerView pauses rendering when its video preview hides during expand;
|
||||
// PlayerService.playerSheetDidAppear is gated behind background playback, so it
|
||||
// PlayerService.playerSheetDidAppear skips resuming while PiP is active, so it
|
||||
// can't be relied on to resume. On macOS this also recovers the sheet re-open
|
||||
// black screen when the shared render view reappears without a window re-parent.
|
||||
backend.resumeRendering()
|
||||
|
||||
@@ -270,10 +270,14 @@ private struct BehaviorSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
#if !os(macOS)
|
||||
// macOS never suspends apps, so playback always continues in the
|
||||
// background — the toggle would have no effect there
|
||||
Toggle(
|
||||
String(localized: "settings.playback.backgroundPlayback"),
|
||||
isOn: $settings.backgroundPlaybackEnabled
|
||||
)
|
||||
#endif
|
||||
|
||||
#if os(tvOS)
|
||||
Toggle(
|
||||
|
||||
Reference in New Issue
Block a user