添加手势而视频在全屏模式下 [英] Add gesture while video in fullscreen mode
本文介绍了添加手势而视频在全屏模式下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是Android版YouTube API为我的影片播放。我想添加一个向左滑动和放大器;正确的手势而视频是全屏模式。
I'm using an Youtube Android API for my videos playback. I wanted to add an Swipe Left & Right Gesture while the video is on full screen mode.
我能够向左滑动和放大器;权当Youtube视频是不是在全屏模式。
I'm able to Swipe Left & Right when the Youtube video is not in full screen mode.
我已经使用了类似的code结构
Android的 - 基本手势检测
I have used similar code structure on Android - basic gesture detection
请指教任何解决我的问题。
Please advice any solution for my problem.
推荐答案
要总结实施向左滑动和放大器;右的特点:
To summarize implementation of "Swipe Left & Right" feature:
- 导入 MotionEvent 。
- 过滤不需要的运动检测(即偶然触摸在屏幕上)
- 检查
MotionEvent.ACTION_DOWN
,MotionEvent.ACTION_UP
的每一个案件,而MotionEvent。 ACTION_MOVE
。 - 计算速度和X和Y确定运动耐受三角洲
- 添加监听器,当你从上面的#4正确的价值观。
- Import MotionEvent.
- Filter unwanted motion detection (i.e. accidental touch on screen)
- Check each cases of
MotionEvent.ACTION_DOWN
,MotionEvent.ACTION_UP
, andMotionEvent.ACTION_MOVE
. - Calculate velocity and delta of X and Y to determine motion tolerance
- Add listeners when you get the right values from #4 above.
这篇关于添加手势而视频在全屏模式下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文