Skip to content

Commit

Permalink
fix(ios): don't crop video when in repeat mode (#3575)
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch authored Mar 10, 2024
1 parent 366c841 commit 90b31af
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 90b31af

Please sign in to comment.