Skip to content

Commit

Permalink
fix: pause video then switch to the background and return, there will…
Browse files Browse the repository at this point in the history
… be playback error (cocos#3227)
  • Loading branch information
knoxHuang authored Jan 19, 2021
1 parent cbfad36 commit b28f956
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ public void onPrepared(MediaPlayer mp) {
mCurrentState = State.PREPARED;

if (mPositionBeforeRelease > 0) {
CocosVideoView.this.seekTo(mPositionBeforeRelease);
CocosVideoView.this.start();
CocosVideoView.this.seekTo(mPositionBeforeRelease);
mPositionBeforeRelease = 0;
}
}
Expand Down Expand Up @@ -557,6 +557,7 @@ private void release() {
if (mMediaPlayer != null) {
mMediaPlayer.release();
mMediaPlayer = null;
mCurrentState = State.IDLE;
}
}

Expand Down

0 comments on commit b28f956

Please sign in to comment.