compile 'com.shuyu:GSYVideoPlayer:1.6.1'
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
compile 'com.github.CarGuo:GSYVideoPlayer:v1.6.1'
}
/**
* 是否需要在buffer缓冲时,增加外部超时判断
*
* 超时后会走onError接口,播放器通过onPlayError回调出
*
* 错误码为 : BUFFER_TIME_OUT_ERROR = -192
*
* 由于onError之后执行GSYVideoPlayer的OnError,如果不想触发错误,
* 可以重载onError,在super之前拦截处理。
*
* public void onError(int what, int extra){
* do you want before super and return;
* super.onError(what, extra)
* }
*
* @param timeOut 超时时间,毫秒 默认8000
* @param needTimeOutOther 是否需要延时设置,默认关闭
*/
public void setTimeOut(int timeOut, boolean needTimeOutOther) {
this.timeOut = timeOut;
this.needTimeOutOther = needTimeOutOther;
}
-keep class tv.danmaku.ijk.** { *; }
-dontwarn tv.danmaku.ijk.**
-keep class com.shuyu.gsyvideoplayer.** { *; }
-dontwarn com.shuyu.gsyvideoplayer.**
请参看IJKPlayer和AndroidVideoCache相关协议。