提交 8d8a52de 编写于 作者: G guoshuyu

fix cache

上级 2d9932a9
...@@ -113,7 +113,11 @@ public class ProxyCacheManager implements ICacheManager, CacheListener { ...@@ -113,7 +113,11 @@ public class ProxyCacheManager implements ICacheManager, CacheListener {
@Override @Override
public void release() { public void release() {
if (proxy != null) { if (proxy != null) {
proxy.unregisterCacheListener(this); try {
proxy.unregisterCacheListener(this);
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
......
...@@ -387,7 +387,7 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O ...@@ -387,7 +387,7 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O
return; return;
} }
if (mCurrentState == CURRENT_STATE_NORMAL) { if (mCurrentState == CURRENT_STATE_NORMAL) {
if (!mUrl.startsWith("file") && !CommonUtil.isWifiConnected(getActivityContext()) && mNeedShowWifiTip) { if (isShowNetConfirm()) {
showWifiDialog(); showWifiDialog();
return; return;
} }
...@@ -800,8 +800,7 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O ...@@ -800,8 +800,7 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O
return; return;
} }
if (mCurrentState == CURRENT_STATE_NORMAL || mCurrentState == CURRENT_STATE_ERROR) { if (mCurrentState == CURRENT_STATE_NORMAL || mCurrentState == CURRENT_STATE_ERROR) {
if (!mUrl.startsWith("file") && !mUrl.startsWith("android.resource") && !CommonUtil.isWifiConnected(getContext()) if (isShowNetConfirm()) {
&& mNeedShowWifiTip) {
showWifiDialog(); showWifiDialog();
return; return;
} }
...@@ -1005,6 +1004,11 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O ...@@ -1005,6 +1004,11 @@ public abstract class GSYVideoControlView extends GSYVideoView implements View.O
} }
protected boolean isShowNetConfirm() {
return !mUrl.startsWith("file") && !mUrl.startsWith("android.resource") && !CommonUtil.isWifiConnected(getContext())
&& mNeedShowWifiTip && !getGSYVideoManager().isCacheFile();
}
private class ProgressTimerTask extends TimerTask { private class ProgressTimerTask extends TimerTask {
@Override @Override
public void run() { public void run() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册