[IOS] Fix ads when no controls displayed
This commit is contained in:
parent
d6da11d8ef
commit
f54288c54d
1
Video.js
1
Video.js
@ -535,6 +535,7 @@ Video.propTypes = {
|
|||||||
onPictureInPictureStatusChanged: PropTypes.func,
|
onPictureInPictureStatusChanged: PropTypes.func,
|
||||||
needsToRestoreUserInterfaceForPictureInPictureStop: PropTypes.func,
|
needsToRestoreUserInterfaceForPictureInPictureStop: PropTypes.func,
|
||||||
onExternalPlaybackChange: PropTypes.func,
|
onExternalPlaybackChange: PropTypes.func,
|
||||||
|
adTagUrl: PropTypes.string,
|
||||||
onReceiveAdEvents: PropTypes.func,
|
onReceiveAdEvents: PropTypes.func,
|
||||||
|
|
||||||
/* Required by react-native */
|
/* Required by react-native */
|
||||||
|
@ -1116,7 +1116,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
}
|
}
|
||||||
|
|
||||||
func requestAds() {
|
func requestAds() {
|
||||||
if self._playerViewController != nil {
|
|
||||||
// Create ad display container for ad rendering.
|
// Create ad display container for ad rendering.
|
||||||
let adDisplayContainer = IMAAdDisplayContainer(adContainer: self, viewController: self.reactViewController())
|
let adDisplayContainer = IMAAdDisplayContainer(adContainer: self, viewController: self.reactViewController())
|
||||||
|
|
||||||
@ -1131,7 +1130,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
adsLoader.requestAds(with: request)
|
adsLoader.requestAds(with: request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - IMAAdsLoaderDelegate
|
// MARK: - IMAAdsLoaderDelegate
|
||||||
|
|
||||||
@ -1142,7 +1140,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
|
|
||||||
// Create ads rendering settings and tell the SDK to use the in-app browser.
|
// Create ads rendering settings and tell the SDK to use the in-app browser.
|
||||||
let adsRenderingSettings: IMAAdsRenderingSettings = IMAAdsRenderingSettings();
|
let adsRenderingSettings: IMAAdsRenderingSettings = IMAAdsRenderingSettings();
|
||||||
adsRenderingSettings.linkOpenerPresentingController = self._playerViewController;
|
adsRenderingSettings.linkOpenerPresentingController = self.reactViewController();
|
||||||
|
|
||||||
adsManager.initialize(with: adsRenderingSettings)
|
adsManager.initialize(with: adsRenderingSettings)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user