Skip to content

Commit

Permalink
fix(android): playback doesn't work with 0 startPositionMs
Browse files Browse the repository at this point in the history
  • Loading branch information
YangJonghun committed May 16, 2024
1 parent 464ce7c commit f954358
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,13 @@ private void initializePlayerSource(ReactExoplayerView self, DrmSessionManager d
boolean haveResumePosition = resumeWindow != C.INDEX_UNSET;
if (haveResumePosition) {
player.seekTo(resumeWindow, resumePosition);
}
if (startPositionMs >= 0) {
player.setMediaSource(mediaSource, false);
} else if (startPositionMs == 0) {
player.setMediaSource(mediaSource, true);
} else if (startPositionMs > 0) {
player.setMediaSource(mediaSource, startPositionMs);
} else {
player.setMediaSource(mediaSource, !haveResumePosition);
player.setMediaSource(mediaSource, false);
}
player.prepare();
playerNeedsSource = false;
Expand Down

0 comments on commit f954358

Please sign in to comment.