fix(android): playback doesn't work with 0 startPositionMs (#3784)

This commit is contained in:
YangJH 2024-05-17 21:21:02 +09:00 committed by GitHub
parent 324b461527
commit 66e0ba579b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -750,11 +750,11 @@ public class ReactExoplayerView extends FrameLayout implements
boolean haveResumePosition = resumeWindow != C.INDEX_UNSET; boolean haveResumePosition = resumeWindow != C.INDEX_UNSET;
if (haveResumePosition) { if (haveResumePosition) {
player.seekTo(resumeWindow, resumePosition); player.seekTo(resumeWindow, resumePosition);
} player.setMediaSource(mediaSource, false);
if (startPositionMs >= 0) { } else if (startPositionMs > 0) {
player.setMediaSource(mediaSource, startPositionMs); player.setMediaSource(mediaSource, startPositionMs);
} else { } else {
player.setMediaSource(mediaSource, !haveResumePosition); player.setMediaSource(mediaSource, true);
} }
player.prepare(); player.prepare();
playerNeedsSource = false; playerNeedsSource = false;