From 07eac65c1c7e1d59a92f3d9ab0ead1ec020551ce Mon Sep 17 00:00:00 2001 From: shuyu <359369982@qq.com> Date: Thu, 8 Dec 2016 10:21:04 +0800 Subject: [PATCH] readme --- .../com/shuyu/gsyvideoplayer/GSYVideoPlayer.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java index 84186a7..fea244d 100644 --- a/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java +++ b/gsyVideoPlayer/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoPlayer.java @@ -101,6 +101,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. protected int mSeekToInAdvance = -1; //// TODO: 2016/11/13 跳过广告 + protected int mBuffterPoint;//缓存进度 protected int mSeekTimePosition; //手动改变滑动的位置 @@ -231,7 +232,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. HttpProxyCacheServer proxy = GSYVideoManager.getProxy(getContext().getApplicationContext(), cachePath); url = proxy.getProxyUrl(url); mCacheFile = (!url.startsWith("http")); - if (!mCacheFile) { + if (!mCacheFile && GSYVideoManager.instance() != null) { proxy.registerCacheListener(GSYVideoManager.instance(), mOriginUrl); } } @@ -254,6 +255,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. cancelProgressTimer(); GSYVideoManager.instance().releaseMediaPlayer(); releasePauseCoverAndBitmap(); + mBuffterPoint = 0; } if (mAudioManager != null) { mAudioManager.abandonAudioFocus(onAudioFocusChangeListener); @@ -836,6 +838,7 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. if (mCurrentState != CURRENT_STATE_NORMAL && mCurrentState != CURRENT_STATE_PREPAREING) { if (percent != 0) { setTextAndProgress(percent); + mBuffterPoint = percent; Debuger.printfLog("Net speed: " + getNetSpeedText() + " percent " + percent); } //循环清除进度 @@ -1221,4 +1224,13 @@ public abstract class GSYVideoPlayer extends GSYBaseVideoPlayer implements View. public void setSeekOnStart(long seekOnStart) { this.mSeekOnStart = seekOnStart; } + + + /** + * 缓冲进度/缓存进度 + */ + public int getBuffterPoint() { + return mBuffterPoint; + } + } \ No newline at end of file -- GitLab