DragVideo

Introduction: DragVideo,一种在播放视频时,可以任意拖拽视频的方案
More: Author   ReportBugs   
Tags:

A Method to Drag the Video When Playing Video

一种在播放视频时,能够拖拽的方案

为什么有这个工程

经常在爱奇艺网站上看电影,看到如果滑动掩盖了播放窗口后,就后在最下面有一个小播放界面。并且这个播放界面,是可以任意拖拽的。感觉很酷

DragVideoWeb

既然 web 端能实现,就想了想在移动端设备上,是否也能实现这个效果,于是就有了...

效果图:

DragVideo

实现思路:

  • 1、播放视频的 view 选择 TextureView
  • 2、ListView 下方盖上自定义 ViewDragHelper,当在播放视频时,通过自定义 ViewDragHelper 进行拖动 TextureView
  • 3、进行渐变处理,让两个 view 的文字能够交替显示
  • 4、当 TextureView 到达右下方时,控制在水平方向上拖动,到达左边界时,如果再滑动,就销毁 TextureView

代码分析:

欢迎关注我的个人公众号,android 技术干货,问题深度总结,FrameWork 源码解析,插件化研究,最新开源项目推荐

这里写图片描述

License

Copyright (C) 2016 hejunlin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

特别鸣谢:

@flavienlaurent(法国 Fourmob 公司工程师)仿 Youtube 方案、@Minsoo, Kim(韩国 Kakao Corp 工程师)、JOJO(阿里巴巴工程师)

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools