From 66e0ba579b84d745b4ca1b076d41d8eb880ef616 Mon Sep 17 00:00:00 2001 From: YangJH Date: Fri, 17 May 2024 21:21:02 +0900 Subject: [PATCH] fix(android): playback doesn't work with 0 startPositionMs (#3784) --- .../java/com/brentvatne/exoplayer/ReactExoplayerView.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 1b8dec49..567a4eeb 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -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;