diff --git a/CHANGELOG.md b/CHANGELOG.md index 013871e4..a2bec6ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index a339aff4..f482ff7c 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -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