mirror of
https://github.com/yattee/yattee.git
synced 2026-06-27 09:04:19 +00:00
Cancel tvOS scrub with Menu button instead of seeking
Pressing Menu while scrubbing now discards the pending scrub and leaves playback time unchanged, instead of committing the seek via the focus-loss path.
This commit is contained in:
@@ -85,6 +85,10 @@ struct TVPlayerView: View {
|
||||
/// last press.
|
||||
@State private var scrubberRemoteSeekTask: Task<Void, Never>?
|
||||
|
||||
/// Bumped to signal `TVPlayerProgressBar` to cancel an in-progress scrub
|
||||
/// without performing the seek (used when Menu is pressed during scrub).
|
||||
@State private var cancelScrubTrigger: UUID?
|
||||
|
||||
// MARK: - Computed Properties
|
||||
|
||||
private var playerService: PlayerService? {
|
||||
@@ -206,7 +210,8 @@ struct TVPlayerView: View {
|
||||
remoteSeekTime: scrubberRemoteSeekTime,
|
||||
onRemoteSeek: { forward in
|
||||
triggerScrubberRemoteSeek(forward: forward)
|
||||
}
|
||||
},
|
||||
cancelScrubTrigger: cancelScrubTrigger
|
||||
)
|
||||
.transition(.opacity.animation(.easeInOut(duration: 0.25)))
|
||||
}
|
||||
@@ -623,8 +628,9 @@ struct TVPlayerView: View {
|
||||
// Third: hide details panel
|
||||
hideDetailsPanel()
|
||||
} else if isScrubbing {
|
||||
// Fourth: exit scrub mode (handled by progress bar losing focus)
|
||||
// Just hide controls
|
||||
// Fourth: cancel scrub without seeking, then hide controls. The
|
||||
// subsequent focus-loss path sees cleared scrub state and no-ops.
|
||||
cancelScrubTrigger = UUID()
|
||||
hideControls()
|
||||
} else if controlsVisible {
|
||||
// Fifth: hide controls
|
||||
|
||||
Reference in New Issue
Block a user