-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
很痛苦哥们,你播放完成回调没有写 #32
Comments
老实了哥们,帮我看看什么问题,把你项目中的三个library引入后,代码没改,现在打开视频白屏报错: ExoPlayerImplInternal: Source error |
开启本地代理: mLocalProxyEnable = false;,视频可以播放,可以缓冲后面十几秒,但是缓存文件夹历并没有缓存文件,如果 mLocalProxyEnable = true,视频直接白屏报错,提示上面刚说的异常,error信息提示连接失败,127.0.0.1:37207的问题,麻烦老哥帮忙排查一下问题,解决一下,感谢。 |
OK,解决了 |
只能把你代码拉下来手动导包当做library引入了,依赖不是最新版,包括你现在的代码,只有onCompletion回调,具体实现你没有写。
我只用到了ExoPlayer,ijk的没用到没改,如果你看到了,可以去加上播放完成的回调:
BasePlayerImpl中加入:
protected void notifyOnCompletion() {
VideoProxyThreadUtils.runOnUiThread(() -> {
if (mOnCompletionListener != null) {
mOnCompletionListener.onCompletion();
}
});
}
ExoPlayerImpl中:
@OverRide
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
LogUtils.i(TAG, "onPlayerStateChanged playWhenReady="+playWhenReady+", playbackState="+playbackState);
switch(playbackState) {
case Player.STATE_BUFFERING:
break;
case Player.STATE_IDLE:
break;
case Player.STATE_READY:
if (mPrepareState == PREPARING_STATE) {
notifyOnPrepared();
mPrepareState = PREPARED_STATE;
}
break;
case Player.STATE_ENDED:
//新加
notifyOnCompletion();
break;
default:
break;
}
}
好了,我要把你的代码引入我的项目了,我加班了哥们儿。
The text was updated successfully, but these errors were encountered: