添加手势而视频在全屏模式下 [英] Add gesture while video in fullscreen mode

查看:162
本文介绍了添加手势而视频在全屏模式下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是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:


  1. 导入 MotionEvent

  2. 过滤不需要的运动检测(即偶然触摸在屏幕上)

  3. 检查 MotionEvent.ACTION_DOWN MotionEvent.ACTION_UP 的每一个案件,而 MotionEvent。 ACTION_MOVE

  4. 计算速度和X和Y确定运动耐受三角洲

  5. 添加监听器,当你从上面的#4正确的价值观。

  1. Import MotionEvent.
  2. Filter unwanted motion detection (i.e. accidental touch on screen)
  3. Check each cases of MotionEvent.ACTION_DOWN, MotionEvent.ACTION_UP, and MotionEvent.ACTION_MOVE.
  4. Calculate velocity and delta of X and Y to determine motion tolerance
  5. Add listeners when you get the right values from #4 above.

这篇关于添加手势而视频在全屏模式下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆