Keep playback alive when dismissing tvOS player with Menu button

Calling stop() on Menu-button dismiss cleared currentVideo and tore down
the backend, so audio did not continue and the "Now Playing" sidebar
tab never appeared. Match the iOS/macOS dismissal path instead and just
collapse the fullScreenCover.
This commit is contained in:
Arkadiusz Fal
2026-04-14 01:34:21 +02:00
parent 2c49a5e65a
commit babaca74f2

View File

@@ -467,10 +467,10 @@ struct TVPlayerView: View {
}
private func dismissPlayer() {
// Save progress and stop player before dismissing (matches iOS/macOS pattern)
// This ensures watch history is updated when user exits player with Menu button
playerService?.stop()
// Collapse the player but keep it alive so audio continues in the background
// and the "Now Playing" sidebar entry can restore the session. Matches the
// iOS/macOS ExpandedPlayerWindow dismissal path, which also does not stop()
// on dismiss.
appEnvironment?.navigationCoordinator.isPlayerExpanded = false
dismiss()
}