Seeking to start time

This commit is contained in:
Yavor Ivanov 2023-02-06 23:31:14 +02:00
parent 7da44c238f
commit 0f6057bea5

View File

@ -537,7 +537,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
func setPlaybackRange(_ item:AVPlayerItem!, withVideoStart videoStart:Int64?, withVideoEnd videoEnd:Int64?) {
if (videoStart != nil) {
item.reversePlaybackEndTime = CMTimeMake(value: videoStart!, timescale: 1000)
let start = CMTimeMake(value: videoStart!, timescale: 1000)
item.reversePlaybackEndTime = start
_pendingSeekTime = Float(CMTimeGetSeconds(start))
_pendingSeek = true
}
if (videoEnd != nil) {
item.forwardPlaybackEndTime = CMTimeMake(value: videoEnd!, timescale: 1000)