IOS: fix ui frame drop on load

This commit is contained in:
Stipe Perković 2022-09-06 12:13:54 +02:00
parent 8d39a9a75f
commit 6e6ae9d7c9

View File

@ -274,7 +274,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
self._playerItem?.preferredPeakBitRate = Double(maxBitRate)
}
self._player = AVPlayer(playerItem: self._playerItem)
self._player = AVPlayer()
DispatchQueue.global(qos: .default).async {
self._player?.replaceCurrentItem(with: playerItem)
}
self._playerObserver.player = self._player
self.applyModifiers()
self._player?.actionAtItemEnd = .none