Comments (8)
you can override func panGestureBegan, panGestureChanged, panGestureEnded
/// Add Customize functions here
open func customizeUIComponents() {
tapGesture.addTarget(self, action: #selector(onTapGestureTapped(_:)))
tapGesture.numberOfTapsRequired = 1
addGestureRecognizer(tapGesture)
panGesture.addTarget(self, action: #selector(panDirection(_:)))
addGestureRecognizer(panGesture)
doubleTapGesture.addTarget(self, action: #selector(doubleGestureAction))
doubleTapGesture.numberOfTapsRequired = 2
tapGesture.require(toFail: doubleTapGesture)
addGestureRecognizer(doubleTapGesture)
}
from ksplayer.
thank you, can you please look into my feature request?
from ksplayer.
Could you please give an example of how this works? I'm having problems getting swipe up and down to execute my own code.
from ksplayer.
i only has the tvos simulator. so i can't try the Gesture
from ksplayer.
There is an option to display an on-screen apple remote, complete with gestures.
Window->Show Apple Remote
in the simulator window.
from ksplayer.
You have to press opt key to use gestures
from ksplayer.
thank. i will try it.
from ksplayer.
you can override func doubleTapGestureAction, tapGestureAction, panGestureAction
@objc open func doubleTapGestureAction() {
toolBar.playButton.sendActions(for: .primaryActionTriggered)
isMaskShow = true
}
@objc open func tapGestureAction(_: UITapGestureRecognizer) {
if srtControl.view.isHidden {
isMaskShow.toggle()
} else {
srtControl.view.isHidden = true
}
}
@objc private func panGestureAction(_ pan: UIPanGestureRecognizer) {
// 播放结束时,忽略手势,锁屏状态忽略手势
guard !replayButton.isSelected, !isLock else { return }
// 根据上次和本次移动的位置,算出一个速率的point
let velocityPoint = pan.velocity(in: self)
switch pan.state {
case .began:
// 使用绝对值来判断移动的方向
if abs(velocityPoint.x) > abs(velocityPoint.y) {
scrollDirection = .horizontal
} else {
scrollDirection = .vertical
}
panGestureBegan(location: pan.location(in: self), direction: scrollDirection)
case .changed:
panGestureChanged(velocity: velocityPoint, direction: scrollDirection)
case .ended:
panGestureEnded()
default:
break
}
}
from ksplayer.
Related Issues (20)
- 无法显示cc隐藏字幕
- Fullscreen button
- Demo App HOT 4
- 25 / 30 FPS streams stutter HOT 28
- 某些视频播放时会崩溃 HOT 3
- tvOS 端播放时卡顿会是什么原因? HOT 6
- OpenSSL and KSME Crash on tvOS HOT 10
- Slider and SwiftUI
- 在播放一个广播音频时,会一直在buffering HOT 4
- 请问有什么方式可以设置一个默认的播放速度 类似默认的播放开始位置一样 谢谢 HOT 4
- 音频是使用native原生解码吗? HOT 4
- Potentially Incorrect Uses of "available" HOT 2
- SOS,播放器播放过程中,视频流自己创建了新的控件 HOT 3
- Pauses when playing m3u8 HOT 2
- SPM无法添加 HOT 2
- How to set `subtitleDelay` now? HOT 1
- Testing new OpenSSL initialization - results and first crashes HOT 11
- 画面比例会影响pip功能
- 能否删掉默认的 User-Agent: ksplayer? HOT 1
- 如何设置字幕的 UA? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ksplayer.