diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index b8e6c06b..8f9e9d16 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -266,8 +266,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH // MARK: - Player and source @objc func setSrc(_ source:NSDictionary!) { - DispatchQueue.global(qos: .default).async { [weak self] in - guard let self = self else {return} + let dispatchClosure = { self._source = VideoSource(source) if (self._source?.uri == nil || self._source?.uri == "") { self._player?.replaceCurrentItem(with: nil) @@ -361,6 +360,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH }.catch{_ in } self._videoLoadStarted = true } + DispatchQueue.global(qos: .default).async(execute: dispatchClosure) } @objc