Skip to content

Commit

Permalink
修复ExoPlayer出错状态下,点击重试后不能之前播放的时刻继续播放的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Doikki committed Aug 17, 2018
1 parent 2a5658d commit ce28186
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
ijkVideoView.setPlayerConfig(new PlayerConfig.Builder()
.autoRotate()//自动旋转屏幕
// .usingSurfaceView()//使用SurfaceView
.enableCache()
// .enableCache()
.build());
ijkVideoView.setUrl(URL);
ijkVideoView.setVideoController(mController);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ public void release() {
mDataSource = null;
mIsPreparing = true;
mIsBuffering = false;
lastReportedPlaybackState = Player.STATE_IDLE;
lastReportedPlayWhenReady = false;
}

@Override
Expand Down Expand Up @@ -319,10 +321,12 @@ public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {

switch (playbackState) {
case Player.STATE_BUFFERING:
if (mPlayerEventListener != null) {
mPlayerEventListener.onInfo(IMediaPlayer.MEDIA_INFO_BUFFERING_START, mInternalPlayer.getBufferedPercentage());
if (!mIsPreparing) {
if (mPlayerEventListener != null) {
mPlayerEventListener.onInfo(IMediaPlayer.MEDIA_INFO_BUFFERING_START, mInternalPlayer.getBufferedPercentage());
}
mIsBuffering = true;
}
mIsBuffering = true;
break;
case Player.STATE_READY:
break;
Expand Down

0 comments on commit ce28186

Please sign in to comment.