fix(ios): ensure we stop playback on invalid or empty url

This commit is contained in:
olivier bouillet 2022-10-02 21:33:53 +02:00
parent c197271889
commit 2efa746eed

View File

@ -219,6 +219,12 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
@objc
func setSrc(_ source:NSDictionary!) {
_source = VideoSource(source)
if (_source?.uri == nil || _source?.uri == "") {
DispatchQueue.global(qos: .default).async {
self._player?.replaceCurrentItem(with: nil)
}
return;
}
removePlayerLayer()
_playerObserver.player = nil
_playerObserver.playerItem = nil