README.md 7.8 KB
Newer Older
S
readme  
shuyu 已提交
1

S
readme  
shuyu 已提交
2
![](https://github.com/CarGuo/GSYVideoPlayer/blob/master/home_logo.png)
S
readme  
shuyu 已提交
3

S
Shuyu Guo 已提交
4
## 基于[IJKPlayer](https://github.com/Bilibili/ijkplayer),实现了多功能的视频播放器。 (请仔细阅读下方各项说明,大多数问题可在下方找到解答)。
S
Shuyu Guo 已提交
5

S
Shuyu Guo 已提交
6
状态 | 功能
S
Shuyu Guo 已提交
7 8
-------- | ---
**支持**|**边播边缓存,使用了[AndroidVideoCache](https://github.com/danikula/AndroidVideoCache)。**
S
Shuyu Guo 已提交
9 10 11
**支持**|**列表播放;列表连续播放;重力旋转与手动旋转;视频本身rotation旋转属性。**
**支持**|**全屏切换动画效果;小窗口播放,可拖动。**
**支持**|**快播和慢播;网络视频加载速度。**
S
Shuyu Guo 已提交
12
**支持**|**调整显示比例:默认、16:9、4:3、填充。**
S
Shuyu Guo 已提交
13 14 15 16 17 18
**支持**|**播放时旋转画面角度(0,90,180,270);镜像旋转。**
**支持**|**暂停前后台切换不黑屏;调整不同清晰度的支持。**
**支持**|**Https;IJKPlayer和EXOPlayer切换。**
**支持**|**锁定/解锁全屏点击功能;进度条小窗口预览(测试)。**
**支持**|**全屏与非全屏两套布局切换;弹幕功能。**
**支持**|**其他协议和编码concat、rtsp、crypto、mpeg等。**
S
shuyu 已提交
19
**支持**|**没有任何操作控件的纯播放支持。**
S
Shuyu Guo 已提交
20
待支持|**自带广告功能(目前需要自己实现)。**
S
readme  
shuyu 已提交
21

S
shuyu 已提交
22
[![](https://jitpack.io/v/CarGuo/GSYVideoPlayer.svg)](https://jitpack.io/#CarGuo/GSYVideoPlayer)
S
shuyu 已提交
23
[ ![Download](https://api.bintray.com/packages/carguo/GSYVideoPlayer/gsyVideoPlayer/images/download.svg) ](https://bintray.com/carguo/GSYVideoPlayer/gsyVideoPlayer/_latestVersion)
S
readme  
shuyu 已提交
24
[![Build Status](https://travis-ci.org/CarGuo/GSYVideoPlayer.svg?branch=master)](https://travis-ci.org/CarGuo/GSYVideoPlayer)
S
shuyu 已提交
25

S
Shuyu Guo 已提交
26
## 使用依赖(支持jcenter或jitpack)
S
readme  
shuyu 已提交
27

S
shuyu 已提交
28
##### 新版本调整了代码结构,如更新后显示类路径错误,参考demo调整包路径即可。
29

30
### 1、JCenter 引入方法(推荐)
S
shuyu 已提交
31

S
Shuyu Guo 已提交
32
**你可以选择下面三种的其中一种,在module下的build.gradle添加。**
33

S
shuyu 已提交
34
#### A、直接引入
S
shuyu 已提交
35
```
S
shuyu 已提交
36
//完整版引入
S
shuyu 已提交
37
compile 'com.shuyu:GSYVideoPlayer:2.0.6'
S
readme  
shuyu 已提交
38

S
shuyu 已提交
39 40
```

S
shuyu 已提交
41
#### B、添加java和你想要的so支持:
42 43

```
S
shuyu 已提交
44
compile 'com.shuyu:gsyVideoPlayer-java:2.0.6'
45 46

//根据你的需求
S
shuyu 已提交
47 48 49 50 51
compile 'com.shuyu:gsyVideoPlayer-armv5:2.0.6'
compile 'com.shuyu:gsyVideoPlayer-armv7a:2.0.6'
compile 'com.shuyu:gsyVideoPlayer-arm64:2.0.6'
compile 'com.shuyu:gsyVideoPlayer-x64:2.0.6'
compile 'com.shuyu:gsyVideoPlayer-x86:2.0.6'
52 53 54

```

S
shuyu 已提交
55
#### C、支持其他格式协议的(mpeg,rtsp, concat、crypto协议)
56

S
Shuyu Guo 已提交
57 58
A、B普通版本支持263/264/265等,对于mpeg编码会有声音无画面情况。
C 引入的so支持mpeg编码和其他补充协议,但是so包相对变大。
59 60
 
```
S
shuyu 已提交
61
compile 'com.shuyu:gsyVideoPlayer-java:2.0.6' 
62

S
shuyu 已提交
63
compile 'com.shuyu:gsyVideoPlayer-ex_so:2.0.6' 
64 65 66

```

S
shuyu 已提交
67 68 69
#### D、支持使用ijkPlayer的so

```
S
shuyu 已提交
70 71 72 73 74
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.2'
compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.2'
compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.2'
compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.2'
compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.2'
S
shuyu 已提交
75
```
76

S
readme  
shuyu 已提交
77 78
--------------------------------------------------------------------------------

S
shuyu 已提交
79
### 2、JitPack引入方法
S
shuyu 已提交
80

S
shuyu 已提交
81
#### First、在project下的build.gradle添加
S
readme  
shuyu 已提交
82
```
S
shuyu 已提交
83 84 85 86 87 88
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
S
readme  
shuyu 已提交
89
```
S
readme  
shuyu 已提交
90

S
shuyu 已提交
91
#### Sencond、在module下的build.gradle添加
S
readme  
shuyu 已提交
92

S
Shuyu Guo 已提交
93
**你可以选择下面三种的其中一种,在module下的build.gradle添加。**
S
shuyu 已提交
94

S
shuyu 已提交
95
#### A、直接引入
S
readme  
shuyu 已提交
96
```
S
shuyu 已提交
97
//完整版引入
S
shuyu 已提交
98
compile 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v2.0.6'
S
shuyu 已提交
99 100 101

```

S
shuyu 已提交
102
#### B、添加java和你想要的so支持:
S
shuyu 已提交
103 104 105

```

S
shuyu 已提交
106
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v2.0.6'
S
shuyu 已提交
107 108

//根据你的需求
S
shuyu 已提交
109 110 111 112 113
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x64:v2.0.6'
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x86:v2.0.6'
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-arm64:v2.0.6'
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv5:v2.0.6'
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv7a:v2.0.6'
S
shuyu 已提交
114 115 116

```

S
shuyu 已提交
117
#### C、支持其他格式协议的(mpeg,rtsp, concat、crypto协议)
S
shuyu 已提交
118

S
Shuyu Guo 已提交
119 120
A、B普通版本支持263/264/265等,对于mpeg编码会有声音无画面情况。
C 方法引入的so支持mpeg编码和其他补充协议,但是so包相对变大。
S
shuyu 已提交
121 122
 
```
S
shuyu 已提交
123
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v2.0.6'
S
shuyu 已提交
124

S
shuyu 已提交
125
compile 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v2.0.6'
S
shuyu 已提交
126

S
readme  
shuyu 已提交
127
```
S
Shuyu Guo 已提交
128
   
S
readme  
shuyu 已提交
129
--------------------------------------------------------------------------------
S
v1.5.8  
shuyu 已提交
130

S
readme  
shuyu 已提交
131
* ### 下方文档以及问题集锦,你想要知道的大部分都在里面。
S
Shuyu Guo 已提交
132 133 134

* ### <a href="https://github.com/CarGuo/GSYVideoPlayer/blob/master/QUESTION.md">有问题请先下面问题集锦中查阅(如依赖不成功,播放不成功等等)。</a>

S
shuyu 已提交
135
* ### QQ群,有兴趣的可以进来(群里平时可能比较吵):174815284 。
S
readme  
shuyu 已提交
136

S
readme  
shuyu 已提交
137 138 139 140
--------------------------------------------------------------------------------

## 文档Wiki

S
shuyu 已提交
141
### [--- 使用说明、接口文档 - 入口](https://github.com/CarGuo/GSYVideoPlayer/wiki)
S
readme  
shuyu 已提交
142

S
readme  
shuyu 已提交
143 144
## 其他

S
shuyu 已提交
145
### [--- 问题集锦 - 入口 ](https://github.com/CarGuo/GSYVideoPlayer/blob/master/QUESTION.md)
S
Shuyu Guo 已提交
146
### [--- 项目支持视频格式(如果遇上黑屏,没声音)](https://github.com/CarGuo/GSYVideoPlayer/blob/master/DECODERS.md)
S
shuyu 已提交
147 148
### [--- IJKPlayer问题 - 入口](http://www.jianshu.com/p/220b00d00deb) 
### [--- IJKPlayer编译自定义SO - 入口](http://www.jianshu.com/p/bd289e25d272) 
S
Shuyu Guo 已提交
149
### [--- 简书详解 (项目的基础)- 入口](http://www.jianshu.com/p/9fe377dd9750)
S
Shuyu Guo 已提交
150
### [--- 版本更新说明 - 入口](https://github.com/CarGuo/GSYVideoPlayer/blob/master/UPDATE_VERSION.md)
S
readme  
shuyu 已提交
151

S
shuyu 已提交
152
 
S
readme  
shuyu 已提交
153
## 运行效果
S
readme  
shuyu 已提交
154

S
Shuyu Guo 已提交
155
* ### 1、打开一个播放(旋转、镜像、填充)
S
Shuyu Guo 已提交
156
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/11.gif" width="240px" height="426px"/>
S
1.1.5  
shuyu 已提交
157

S
Shuyu Guo 已提交
158
* ### 2、列表/详情模式(动画、旋转、小窗体)
S
Shuyu Guo 已提交
159 160

<div>
S
Shuyu Guo 已提交
161 162 163
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/22.gif" width="240px" height="426px"/>
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/33.gif" width="240px" height="426px"/>
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/44.gif" width="240px" height="426px"/>
S
Shuyu Guo 已提交
164
</div>
S
shuyu 已提交
165

S
shuyu 已提交
166
* ### 3、弹幕
S
Shuyu Guo 已提交
167
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/55.gif" width="240px" height="426px"/>
S
shuyu 已提交
168 169

* ### 4、进度条小窗口预览
S
Shuyu Guo 已提交
170
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/07.gif" height="240px"/>
S
shuyu 已提交
171

S
shuyu 已提交
172

S
shuyu 已提交
173 174
## 近期版本

S
shuyu 已提交
175 176 177 178 179
### 2.0.6(2017-08-31)
* 调整了返回按键显示的问题。
* 修改了全屏可能出现缓冲不消失问题。
* 优化了双击问题。

S
shuyu 已提交
180 181 182 183
### 2.0.5(2017-08-26)
* 增加双击暂停开始。
* 增加了SurfaceView的支持:GSYVideoType.setRenderType(GSYVideoType.SUFRACE)。
* 优化了触摸问题、内存问题、dismisstime问题。
S
shuyu 已提交
184

S
shuyu 已提交
185
### 更多版本请查阅:[版本更新说明](https://github.com/CarGuo/GSYVideoPlayer/blob/master/UPDATE_VERSION.md)
S
readme  
shuyu 已提交
186

S
Shuyu Guo 已提交
187 188 189 190 191

## 其他推荐

* [RickText](https://github.com/CarGuo/RickText)
* [LazyRecyclerAdapter](https://github.com/CarGuo/LazyRecyclerAdapter)
S
Shuyu Guo 已提交
192 193

## 关于Issues
S
shuyu 已提交
194 195 196 197 198 199 200 201 202 203 204 205

```
提问题前可先查阅上方文档和说明,请在Demo中复现问题。

问题说明:

1、说明那个Demo中哪个页面。
2、问题显现和重现步骤。
3、补充问题的视频流url,截图。
4、补充问题的机型,android版本。
```

S
readme  
shuyu 已提交
206
## 混淆
S
shuyu 已提交
207

S
shuyu 已提交
208 209 210
```
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**
211 212
-keep class com.shuyu.gsyvideoplayer.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.**
S
todo  
shuyu 已提交
213
```
214

S
Shuyu Guo 已提交
215
## 依赖大小参考
S
Shuyu Guo 已提交
216
建议使用ndk过滤,详细参考 [参考第四条 : 4、NDK的so支持](http://www.jianshu.com/p/86e4b336c17d)
S
Shuyu Guo 已提交
217 218 219
![](https://ooo.0o0.ooo/2017/06/15/5941f343a39f5.png)


220 221 222 223
## License

```
请参看IJKPlayer和AndroidVideoCache相关协议。
S
Shuyu Guo 已提交
224
项目最开始是从jiecao过来的,只是后来方向不同,所以慢慢的也异化了。
S
Shuyu Guo 已提交
225
```