Fix autoplay countdown showing in repeat one queue mode

When queue mode was set to repeat one, the "Playing in N seconds"
countdown still appeared after a video ended, showing the next queued
video - then restarting the current one anyway. The video-end path
never consulted the queue mode; only playNext() did, after the
countdown had already run.

- PlayerService.backendDidFinishPlaying: restart immediately in repeat
  one mode, regardless of queue contents, player visibility, background,
  or PiP. This also fixes repeat one never looping with an empty queue.
- ExpandedPlayerSheet.isAutoPlayEnabled: false in repeat one mode, which
  gates all countdown triggers (start on ended, overlay render, re-arm
  on appear) on iOS/macOS.
- TVPlayerView.handleVideoEnded: early-return in repeat one mode so
  tvOS shows neither the countdown nor the replay controls.
This commit is contained in:
Arkadiusz Fal
2026-08-02 15:39:28 +02:00
parent 25f15a1b3e
commit d17423fa5b
3 changed files with 16 additions and 1 deletions

View File

@@ -134,7 +134,8 @@ struct ExpandedPlayerSheet: View {
var isAutoPlayEnabled: Bool {
(appEnvironment?.settingsManager.queueEnabled ?? true) &&
(appEnvironment?.settingsManager.queueAutoPlayNext ?? true)
(appEnvironment?.settingsManager.queueAutoPlayNext ?? true) &&
playerState?.queueMode != .repeatOne
}
var autoPlayCountdownDuration: Int {