Make seek durations configurable in Playback menu and add secondary seek

Playback menu seek items now follow the durations from the active player
controls preset instead of hardcoded 10s/30s labels. AppEnvironment caches
the active preset's center settings (refreshed on preset change
notifications) so menu commands can read them synchronously.

Add secondary seek durations (default 30s) to CenterSectionSettings,
configurable on macOS in Seek Durations settings, used by Shift+arrows in
the player and Cmd+Shift+arrows in the Playback menu.

Also let Cmd-based key equivalents pass through the player keyboard
monitor so menu shortcuts (e.g. Cmd+Option+arrow previous/next video)
work while the player window has focus, and unify macOS built-in preset
primary seek at 10s to match iOS/tvOS (built-in presets version 8).
This commit is contained in:
Arkadiusz Fal
2026-06-19 08:50:39 +02:00
parent 5bc774dd83
commit ca67d480ca
7 changed files with 197 additions and 50 deletions

View File

@@ -11,7 +11,7 @@ extension LayoutPreset {
/// Bump this version whenever any built-in preset definition changes.
/// On launch, the app compares this against the last-applied version
/// and replaces stale built-in presets with fresh copies from code.
static let builtInPresetsVersion = 7
static let builtInPresetsVersion = 8
// MARK: - Built-in Preset IDs
@@ -164,13 +164,13 @@ extension LayoutPreset {
]
// On macOS center settings only drive seek amounts (keyboard arrows
// and default seek buttons); 5s preserves the historical arrow-key step.
// and default seek buttons).
let centerSettings = CenterSectionSettings(
showPlayPause: true,
showSeekBackward: true,
showSeekForward: true,
seekBackwardSeconds: 5,
seekForwardSeconds: 5,
seekBackwardSeconds: 10,
seekForwardSeconds: 10,
leftSlider: .disabled,
rightSlider: .disabled
)
@@ -308,8 +308,8 @@ extension LayoutPreset {
showPlayPause: true,
showSeekBackward: true,
showSeekForward: true,
seekBackwardSeconds: 5,
seekForwardSeconds: 5,
seekBackwardSeconds: 10,
seekForwardSeconds: 10,
leftSlider: .disabled,
rightSlider: .disabled
)