Merge pull request #2848 from sperko00/master

FIX: IOS UI frame drop on loading video
This commit is contained in:
Olivier Bouillet 2022-09-10 12:46:36 +02:00 committed by GitHub
commit 96ff95352d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@
- Fixed crash when iOS seek method called reject on the promise [#2743](https://github.com/react-native-video/react-native-video/pull/2743)
- Fix maxBitRate property being ignored on Android [#2670](https://github.com/react-native-video/react-native-video/pull/2670)
- Fix crash when the source is a cameraroll [#2639] (https://github.com/react-native-video/react-native-video/pull/2639)
- Fix IOS UI frame drop on loading video [#2848] (https://github.com/react-native-video/react-native-video/pull/2848)
### Version 6.0.0-alpha.1

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