mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 02:45:03 +00:00
Expose Background Playback toggle on tvOS, default off
Surfaces the existing iOS/macOS Background Playback setting in the tvOS Playback settings, defaulting to off so audio stops when the user leaves the app via the TV button. Pauses playback on .background/.inactive when the toggle is off, regardless of audio route — the user's setting wins over AirPlay/HomePod handoff. Also auto-shows the tvOS player controls when returning to foreground so the paused state is immediately visible and actionable.
This commit is contained in:
@@ -40,7 +40,7 @@ extension SettingsManager {
|
||||
var backgroundPlaybackEnabled: Bool {
|
||||
get {
|
||||
if let cached = _backgroundPlaybackEnabled { return cached }
|
||||
return bool(for: .backgroundPlayback, default: true)
|
||||
return bool(for: .backgroundPlayback, default: backgroundPlaybackDefault)
|
||||
}
|
||||
set {
|
||||
_backgroundPlaybackEnabled = newValue
|
||||
@@ -48,6 +48,14 @@ extension SettingsManager {
|
||||
}
|
||||
}
|
||||
|
||||
private var backgroundPlaybackDefault: Bool {
|
||||
#if os(tvOS)
|
||||
return false
|
||||
#else
|
||||
return true
|
||||
#endif
|
||||
}
|
||||
|
||||
/// tvOS only: when enabled, the Siri remote Menu button closes the video
|
||||
/// (clears queue, stops playback) instead of only collapsing the player.
|
||||
/// When enabled, the explicit top-bar close button is hidden.
|
||||
|
||||
Reference in New Issue
Block a user