fix(ios): ensure we stop playback on invalid or empty url
This commit is contained in:
parent
c197271889
commit
2efa746eed
@ -219,6 +219,12 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
@objc
|
@objc
|
||||||
func setSrc(_ source:NSDictionary!) {
|
func setSrc(_ source:NSDictionary!) {
|
||||||
_source = VideoSource(source)
|
_source = VideoSource(source)
|
||||||
|
if (_source?.uri == nil || _source?.uri == "") {
|
||||||
|
DispatchQueue.global(qos: .default).async {
|
||||||
|
self._player?.replaceCurrentItem(with: nil)
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
removePlayerLayer()
|
removePlayerLayer()
|
||||||
_playerObserver.player = nil
|
_playerObserver.player = nil
|
||||||
_playerObserver.playerItem = nil
|
_playerObserver.playerItem = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user