From 6e6ae9d7c900df7c19413e1380205f5ed41af0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stipe=20Perkovi=C4=87?= Date: Tue, 6 Sep 2022 12:13:54 +0200 Subject: [PATCH] IOS: fix ui frame drop on load --- ios/Video/RCTVideo.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index a339aff4..a003f814 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