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;
if (haveResumePosition) {
player.seekTo(resumeWindow, resumePosition);
}
if (startPositionMs >= 0) {
player.setMediaSource(mediaSource, false);
} else if (startPositionMs > 0) {
player.setMediaSource(mediaSource, startPositionMs);
} else {
player.setMediaSource(mediaSource, !haveResumePosition);
player.setMediaSource(mediaSource, true);
}
player.prepare();
playerNeedsSource = false;