diff --git a/Swiftfin/Components/GestureView.swift b/Swiftfin/Components/GestureView.swift index 34cbd7c0a..409b193ed 100644 --- a/Swiftfin/Components/GestureView.swift +++ b/Swiftfin/Components/GestureView.swift @@ -174,7 +174,7 @@ class UIGestureView: UIView { let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(didPerformPinch)) let tapGesture = UITapGestureRecognizer(target: self, action: #selector(didPerformTap)) - let doubleTouchGesture = UITapGestureRecognizer(target: self, action: #selector(didPerformTap)) + let doubleTouchGesture = UITapGestureRecognizer(target: self, action: #selector(didPerformDoubleTouch)) doubleTouchGesture.numberOfTouchesRequired = 2 let longPressGesture = UILongPressGestureRecognizer(target: self, action: #selector(didPerformLongPress)) longPressGesture.minimumPressDuration = longPressMinimumDuration diff --git a/Swiftfin/Views/VideoPlayer/VideoPlayer.swift b/Swiftfin/Views/VideoPlayer/VideoPlayer.swift index 046922727..bf3e46cd1 100644 --- a/Swiftfin/Views/VideoPlayer/VideoPlayer.swift +++ b/Swiftfin/Views/VideoPlayer/VideoPlayer.swift @@ -376,6 +376,11 @@ extension VideoPlayer { } private func handleDoubleTouchGesture(unitPoint: UnitPoint, taps: Int) { + if doubleTouchGesture == .gestureLock { + guard !isPresentingOverlay else { return } + isGestureLocked.toggle() + } + guard !isGestureLocked else { updateViewProxy.present(systemName: "lock.fill", title: "Gestures Locked") return @@ -385,10 +390,15 @@ extension VideoPlayer { case .none: return case .aspectFill: () - case .gestureLock: - guard !isPresentingOverlay else { return } - isGestureLocked.toggle() - case .pausePlay: () + case .pausePlay: + switch videoPlayerManager.state { + case .playing: + videoPlayerManager.proxy.pause() + default: + videoPlayerManager.proxy.play() + } + default: + break } } }