diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index ea6d3dda..f90e1470 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -253,7 +253,7 @@ final class PlayerModel: ObservableObject { } #endif - presentingPlayer = true + presentingPlayer = true #if os(macOS) Windows.player.open() diff --git a/Model/SeekModel.swift b/Model/SeekModel.swift index 641a5f9f..852c81b7 100644 --- a/Model/SeekModel.swift +++ b/Model/SeekModel.swift @@ -98,12 +98,6 @@ final class SeekModel: ObservableObject { self.dismissTimer?.invalidate() self.showOSD() } - -// -// player.backend.updateControls { -// self.gestureStart = self.currentTime.seconds -// completionHandler?() -// } } func onSeekGestureEnd() { diff --git a/Shared/Defaults.swift b/Shared/Defaults.swift index cf3648cb..180f3b35 100644 --- a/Shared/Defaults.swift +++ b/Shared/Defaults.swift @@ -113,6 +113,7 @@ extension Defaults.Keys { static let fullScreenPlayerControlsLayout = Key("fullScreenPlayerControlsLayout", default: fullScreenPlayerControlsLayoutDefault) static let horizontalPlayerGestureEnabled = Key("horizontalPlayerGestureEnabled", default: true) static let seekGestureSpeed = Key("seekGestureSpeed", default: 0.5) + static let seekGestureSensitivity = Key("seekGestureSensitivity", default: 20.0) static let showKeywords = Key("showKeywords", default: false) static let showHistoryInPlayer = Key("showHistoryInPlayer", default: false) #if !os(tvOS) diff --git a/Shared/Player/PlayerDragGesture.swift b/Shared/Player/PlayerDragGesture.swift index 16a013f6..fb19bdaa 100644 --- a/Shared/Player/PlayerDragGesture.swift +++ b/Shared/Player/PlayerDragGesture.swift @@ -36,7 +36,7 @@ extension VideoPlayerView { } #endif - if !isVerticalDrag, abs(horizontalDrag) > 15, !isHorizontalDrag { + if !isVerticalDrag, horizontalPlayerGestureEnabled, abs(horizontalDrag) > seekGestureSensitivity, !isHorizontalDrag { isHorizontalDrag = true player.seek.onSeekGestureStart() viewDragOffset = 0 diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 1ea52c83..54a65275 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -67,6 +67,7 @@ struct VideoPlayerView: View { @Default(.horizontalPlayerGestureEnabled) var horizontalPlayerGestureEnabled @Default(.seekGestureSpeed) var seekGestureSpeed + @Default(.seekGestureSensitivity) var seekGestureSensitivity var body: some View { ZStack(alignment: overlayAlignment) { diff --git a/Shared/Settings/PlayerSettings.swift b/Shared/Settings/PlayerSettings.swift index f1e84d25..3fc5255c 100644 --- a/Shared/Settings/PlayerSettings.swift +++ b/Shared/Settings/PlayerSettings.swift @@ -11,6 +11,7 @@ struct PlayerSettings: View { @Default(.fullScreenPlayerControlsLayout) private var fullScreenPlayerControlsLayout @Default(.horizontalPlayerGestureEnabled) private var horizontalPlayerGestureEnabled @Default(.seekGestureSpeed) private var seekGestureSpeed + @Default(.seekGestureSensitivity) private var seekGestureSensitivity @Default(.showKeywords) private var showKeywords @Default(.pauseOnHidingPlayer) private var pauseOnHidingPlayer @Default(.closeLastItemOnPlaybackEnd) private var closeLastItemOnPlaybackEnd @@ -72,17 +73,19 @@ struct PlayerSettings: View { systemControlsCommandsPicker } - Section(header: SettingsHeader(text: "Controls"), footer: controlsLayoutFooter) { - #if !os(tvOS) + #if !os(tvOS) + Section(header: SettingsHeader(text: "Controls"), footer: controlsLayoutFooter) { horizontalPlayerGestureEnabledToggle SettingsHeader(text: "Seek gesture sensitivity", secondary: true) + seekGestureSensitivityPicker + SettingsHeader(text: "Seek gesture speed", secondary: true) seekGestureSpeedPicker SettingsHeader(text: "Regular size", secondary: true) playerControlsLayoutPicker SettingsHeader(text: "Fullscreen size", secondary: true) - #endif - fullScreenPlayerControlsLayoutPicker - } + fullScreenPlayerControlsLayoutPicker + } + #endif Section(header: SettingsHeader(text: "Interface")) { #if os(iOS) @@ -171,7 +174,7 @@ struct PlayerSettings: View { } private var seekGestureSpeedPicker: some View { - Picker("Seek gesture sensitivity", selection: $seekGestureSpeed) { + Picker("Seek gesture speed", selection: $seekGestureSpeed) { ForEach([1, 0.75, 0.66, 0.5, 0.33, 0.25, 0.1], id: \.self) { value in Text(String(format: "%.0f%%", value * 100)).tag(value) } @@ -180,9 +183,21 @@ struct PlayerSettings: View { .modifier(SettingsPickerModifier()) } + private var seekGestureSensitivityPicker: some View { + Picker("Seek gesture sensitivity", selection: $seekGestureSensitivity) { + Text("Highest").tag(1.0) + Text("High").tag(10.0) + Text("Normal").tag(30.0) + Text("Low").tag(50.0) + Text("Lowest").tag(100.0) + } + .disabled(!horizontalPlayerGestureEnabled) + .modifier(SettingsPickerModifier()) + } + @ViewBuilder private var controlsLayoutFooter: some View { #if os(iOS) - Text("Large and very large sizes are not suitable for all devices and using them may cause controls not to fit on the screen.") + Text("Large and bigger layouts are not suitable for all devices and using them may cause controls not to fit on the screen.") #endif } diff --git a/Shared/Settings/SettingsView.swift b/Shared/Settings/SettingsView.swift index 134e460f..1965e691 100644 --- a/Shared/Settings/SettingsView.swift +++ b/Shared/Settings/SettingsView.swift @@ -227,7 +227,7 @@ struct SettingsView: View { case .browsing: return 400 case .player: - return 620 + return 680 case .quality: return 420 case .history: