From 36af01cc7b901e14e68e6bd648b5fa5c5254b3bd Mon Sep 17 00:00:00 2001 From: PierluigiCod <62481658+PierluigiCod@users.noreply.github.com> Date: Mon, 23 Jan 2023 16:49:46 +0100 Subject: [PATCH] fix issue #3009 --- ios/Video/RCTVideo.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 8f3b0e78..baca4d1a 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -243,6 +243,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH } self.removePlayerLayer() self._playerObserver.player = nil + self._resouceLoaderDelegate = nil self._playerObserver.playerItem = nil // perform on next run loop, otherwise other passed react-props may not be set @@ -750,7 +751,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH } func removePlayerLayer() { - _resouceLoaderDelegate = nil _playerLayer?.removeFromSuperlayer() _playerLayer = nil _playerObserver.playerLayer = nil @@ -882,6 +882,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH override func removeFromSuperview() { _player?.pause() _player = nil + _resouceLoaderDelegate = nil _playerObserver.clearPlayer() self.removePlayerLayer()