fix: issue 2744, call replaceCurrentItem in dispatch thread
This commit is contained in:
parent
3bd032b720
commit
12d7dd6d8b
@ -310,7 +310,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
||||
}
|
||||
|
||||
self._player = self._player ?? AVPlayer()
|
||||
self._player?.replaceCurrentItem(with: playerItem)
|
||||
// https://github.com/react-native-video/react-native-video/issues/2744#issuecomment-1237459473
|
||||
DispatchQueue.global(qos: .default).async { [weak self] in
|
||||
self?._player?.replaceCurrentItem(with: playerItem)
|
||||
}
|
||||
self._playerObserver.player = self._player
|
||||
self.applyModifiers()
|
||||
self._player?.actionAtItemEnd = .none
|
||||
|
Loading…
Reference in New Issue
Block a user