mirror of
https://github.com/jellyfin/Swiftfin.git
synced 2024-11-27 00:00:37 +00:00
Make GestureView
respond to double touch gesture (#1260)
This commit is contained in:
parent
c5d6539018
commit
071a1f98e1
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user