fix(ios): don't crop video when in repeat mode (#3575)

This commit is contained in:
Krzysztof Moch 2024-03-10 21:12:47 +01:00 committed by GitHub
parent 366c841c0b
commit 90b31af2c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1365,8 +1365,15 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
if _repeat {
let item: AVPlayerItem! = notification.object as? AVPlayerItem
item.seek(to: _source?.cropStart != nil ? CMTime(value: _source!.cropStart!, timescale: 1000) : CMTime.zero, completionHandler: nil)
self.applyModifiers()
item.seek(
to: _source?.cropStart != nil ? CMTime(value: _source!.cropStart!, timescale: 1000) : CMTime.zero,
toleranceBefore: CMTime.zero,
toleranceAfter: CMTime.zero,
completionHandler: { [weak self] _ in
guard let self else { return }
self.applyModifiers()
}
)
} else {
self.setPaused(true)
_playerObserver.removePlayerTimeObserver()