* fix(ios): destroy adsManager when player detach from super view (#3716) * fix: swift format
This commit is contained in:
parent
ecc946d1c1
commit
e96c17321f
@ -44,6 +44,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
func releaseAds() {
|
||||
guard let adsManager else { return }
|
||||
// Destroy AdsManager may be delayed for a few milliseconds
|
||||
// But what we want is it stopped producing sound immediately
|
||||
// Issue found on tvOS 17, or iOS if view detach & STARTED event happen at the same moment
|
||||
adsManager.volume = 0
|
||||
adsManager.pause()
|
||||
adsManager.destroy()
|
||||
}
|
||||
|
||||
// MARK: - Getters
|
||||
|
||||
func getAdsLoader() -> IMAAdsLoader? {
|
||||
|
@ -1187,6 +1187,10 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
||||
_resouceLoaderDelegate = nil
|
||||
_playerObserver.clearPlayer()
|
||||
|
||||
#if USE_GOOGLE_IMA
|
||||
_imaAdsManager.releaseAds()
|
||||
#endif
|
||||
|
||||
self.removePlayerLayer()
|
||||
|
||||
if let _playerViewController {
|
||||
|
Loading…
Reference in New Issue
Block a user