README.md 6.2 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 5
## 基于[IJKPlayer](https://github.com/Bilibili/ijkplayer),实现了多功能的视频播放器。 (请仔细阅读下方各项说明,大多数问题可在下方找到解答)。
 
S
readme  
shuyu 已提交
6 7 8 9 10 11
* **支持基本的拖动,声音、亮度调节。**
* **支持边播边缓存,使用了[AndroidVideoCache](https://github.com/danikula/AndroidVideoCache)。**
* **支持视频本身自带rotation的旋转。**
* **增加了重力旋转与手动旋转的同步支持。**
* **支持列表播放。**
* **直接添加控件为封面。**
S
shuyu 已提交
12
* **全屏和播放等的动画效果。**
S
readme  
shuyu 已提交
13 14 15
* **列表的全屏效果优化,多种配置模式。**
* **列表的小窗口播放,可拖动。**
* **网络视频加载速度。**
S
shuyu 已提交
16
* **锁定/解锁全屏点击功能。**
S
shuyu 已提交
17
* **支持快播和慢播。**
S
readme  
shuyu 已提交
18
* **调整显示比例:默认、16:9、4:3。**
19
* **暂停时前后台切换不黑屏**
S
1.4.4  
shuyu 已提交
20
* **调整不同清晰度的支持。**
S
readme  
shuyu 已提交
21
* **支持IJKPlayer和EXOPlayer切换。**
S
shuyu 已提交
22
* **进度条小窗口预览(测试)。**
S
readme  
shuyu 已提交
23
* **Https支持。**
24
* **支持播放时旋转画面角度(0,90,180,270)。**
S
readme  
shuyu 已提交
25
* **连续播放一个列表的视频。**
S
shuyu 已提交
26
* **支持全屏与非全屏两套布局切换**
S
shuyu 已提交
27
* **弹幕支持**
S
shuyu 已提交
28
* **镜像旋转**
S
readme  
shuyu 已提交
29

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

S
readme  
shuyu 已提交
34
## 使用依赖(支持jcenter和jitpack)
S
readme  
shuyu 已提交
35

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

S
readme  
shuyu 已提交
38
#### 直接在module下的build.gradle添加
S
shuyu 已提交
39
```
40 41
//完整版
compile 'com.shuyu:GSYVideoPlayer:2.0.0'
S
readme  
shuyu 已提交
42

S
shuyu 已提交
43 44
```

45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
##### 或者

```
compile 'com.shuyu:gsyVideoPlayer-java:2.0.0'

//根据你的需求
compile 'com.shuyu:gsyVideoPlayer-armv5:2.0.0'
compile 'com.shuyu:gsyVideoPlayer-armv7a:2.0.0'
compile 'com.shuyu:gsyVideoPlayer-arm64:2.0.0'
compile 'com.shuyu:gsyVideoPlayer-x64:2.0.0'
compile 'com.shuyu:gsyVideoPlayer-x86:2.0.0'

```

##### 或者 支持更多格式协议的(mpeg,concat、crypto协议)

以上普通版本支持263/264/265,对于mpeg会有有声音无画面情况。
这种方法引入的so支持mpeg编码,但是so包相对变大。
 
```
compile 'com.shuyu:gsyVideoPlayer-java:2.0.0' 

compile 'com.shuyu:gsyVideoPlayer-ex_so:2.0.0' 

```




S
readme  
shuyu 已提交
74 75
--------------------------------------------------------------------------------

S
shuyu 已提交
76
### 2、JitPack引入方法
S
readme  
shuyu 已提交
77
#### 在project下的build.gradle添加
S
readme  
shuyu 已提交
78
```
S
shuyu 已提交
79 80 81 82 83 84
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
S
readme  
shuyu 已提交
85
```
S
readme  
shuyu 已提交
86

S
readme  
shuyu 已提交
87
#### 在module下的build.gradle添加
S
readme  
shuyu 已提交
88

S
readme  
shuyu 已提交
89
```
S
readme  
shuyu 已提交
90
dependencies {
S
shuyu 已提交
91
        compile 'com.github.CarGuo:GSYVideoPlayer:v1.6.9'
S
readme  
shuyu 已提交
92
}
S
readme  
shuyu 已提交
93
```
S
readme  
shuyu 已提交
94

S
readme  
shuyu 已提交
95
--------------------------------------------------------------------------------
S
v1.5.8  
shuyu 已提交
96

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

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

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

S
readme  
shuyu 已提交
103 104 105 106
--------------------------------------------------------------------------------

## 文档Wiki

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

S
readme  
shuyu 已提交
109 110
## 其他

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

S
shuyu 已提交
118
 
S
readme  
shuyu 已提交
119
## 运行效果
S
readme  
shuyu 已提交
120 121

* ### 1、打开一个播放
S
shuyu 已提交
122
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/01.gif" width="240px" height="426px"/>
S
1.1.5  
shuyu 已提交
123

S
readme  
shuyu 已提交
124
* ### 2、列表/详情模式
S
Shuyu Guo 已提交
125 126

<div>
S
readme  
shuyu 已提交
127
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/02.gif" width="240px" height="426px"/>
S
readme  
shuyu 已提交
128
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/05.gif" width="240px" height="426px"/>
S
shuyu 已提交
129
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/04.gif" width="240px" height="426px"/>
S
Shuyu Guo 已提交
130
</div>
S
shuyu 已提交
131

S
shuyu 已提交
132
* ### 3、弹幕
S
readme  
shuyu 已提交
133
<img src="https://github.com/CarGuo/GSYVideoPlayer/blob/master/09.gif" width="360px" height="240px"/>
S
shuyu 已提交
134 135 136


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

S
shuyu 已提交
139

S
shuyu 已提交
140 141
## 近期版本

S
shuyu 已提交
142

S
shuyu 已提交
143 144 145 146 147 148
### 1.6.9(2017-07-08) >>>> [片头广告功能推迟到1.7.0]
* 修改setup的设置参数。
* 升级修改所有回调接口,回调接口中返回当前播放器。
* 修正播放本地文件错误,会错删文件问题。
* 兼容Appbar中使用,感谢[@loveRose](https://github.com/loveRose)
* 非全屏播放器可获取全屏播放器对象。
S
shuyu 已提交
149 150
```
/**
S
shuyu 已提交
151 152 153
 * 获取全屏播放器对象
 *
 * @return GSYVideoPlayer 如果没有则返回空。
S
shuyu 已提交
154
 */
S
shuyu 已提交
155
public GSYVideoPlayer getFullWindowPlayer()
156
```
157

S
shuyu 已提交
158

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

S
shuyu 已提交
161 162 163 164 165 166 167 168 169 170 171 172 173
### 关于Issues

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

问题说明:

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

S
readme  
shuyu 已提交
174
## 混淆
S
shuyu 已提交
175

S
shuyu 已提交
176 177 178
```
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**
179 180
-keep class com.shuyu.gsyvideoplayer.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.**
S
todo  
shuyu 已提交
181
```
182

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


188 189 190 191
## License

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