override func viewDidLoad() {
super.viewDidLoad()
setUpAdsLoader()
requestAds()
setUpContentPlayer()
}
We are requesting for ads first later initialising the content to play. But at the time of ads request we are passing video view as a reference which is loading only in content setup method.
let adDisplayContainer = IMAAdDisplayContainer(
adContainer: videoView, viewController: self, companionSlots: nil)
let request = IMAAdsRequest(
adTagUrl: ViewController.kTestAppAdTagUrl,
adDisplayContainer: adDisplayContainer,
contentPlayhead: contentPlayhead,
userContext: nil)
Because of this facing error as "Ads cannot be requested because the ad container is not attached to the view hierarchy"
Is there any other approach to get this prefetching of ads to be done like for example initially ads will be requested by passing some dummy view to the request later can we replace the view with videoView...
We able to reproduce issue in sample app, above are the changes to be done.
If something is missing or any other info you want me to add please let me know.
Thanks & Regards,
Revathi M.
|
||||||