Skip to content

Commit

Permalink
Merge pull request #2848 from sperko00/master
Browse files Browse the repository at this point in the history
FIX: IOS UI frame drop on loading video
  • Loading branch information
freeboub authored Sep 10, 2022
2 parents 663ae7c + e0dc0da commit 96ff953
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96ff953

Please sign in to comment.