diff --git a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 4c8278b42c..d9fc534be0 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -703,7 +703,7 @@ private void initializePlayerSource(ReactExoplayerView self, DrmSessionManager d if (haveResumePosition) { player.seekTo(resumeWindow, resumePosition); } - if (startPositionMs > 0) { + if (startPositionMs >= 0) { player.setMediaSource(mediaSource, startPositionMs); } else { player.setMediaSource(mediaSource, !haveResumePosition); diff --git a/docs/pages/component/props.md b/docs/pages/component/props.md index d132d9d9ab..7b27244344 100644 --- a/docs/pages/component/props.md +++ b/docs/pages/component/props.md @@ -661,7 +661,7 @@ The following other types are supported on some platforms, but aren't fully docu #### Start playback at a specific point in time Provide an optional `startPosition` for video. Value is in milliseconds. If the `cropStart` prop is applied, it will be applied from that point forward. -(If it is zero or negative, it is ignored) +(If it is negative or undefined or null, it is ignored) Platforms: Android, iOS diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 1646904e0f..dfdde5c566 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -1183,7 +1183,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH _pendingSeek = false } - if _startPosition > 0 { + if _startPosition >= 0 { setSeek([ "time": NSNumber(value: _startPosition), "tolerance": NSNumber(value: 100) diff --git a/src/Video.tsx b/src/Video.tsx index 61441ed8c5..7f99651e7d 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -148,7 +148,7 @@ const Video = forwardRef( mainVer: resolvedSource.mainVer || 0, patchVer: resolvedSource.patchVer || 0, requestHeaders: resolvedSource.headers || {}, - startPosition: resolvedSource.startPosition || -1, + startPosition: resolvedSource.startPosition ?? -1, cropStart: resolvedSource.cropStart || 0, cropEnd: resolvedSource.cropEnd, title: resolvedSource.title,