- (BCOVVideo *)videoWithURL:(NSURL *)url adTag:(NSString *)adTag {
BCOVSource *source = [[BCOVSource alloc] initWithURL:url deliveryMethod:kBCOVSourceDeliveryHLS properties:nil];
BCOVCuePoint *cuePoint = [BCOVCuePoint beforeCuePointOfType:kBCOVIMACuePointTypeAd properties:@{kBCOVIMAAdTag : adTag}];
return [[BCOVVideo alloc] initWithSource:source cuePoints:[BCOVCuePointCollection collectionWithArray:@[cuePoint]] properties:@{}];
}
BCOVPlayerSDKManager *manager = [BCOVPlayerSDKManager sharedManager];
IMASettings *imaSettings = [[IMASettings alloc] init];imaSettings.ppid = kDoubleclickPublisherID;imaSettings.language = @"en-US";
IMAAdsRenderingSettings *renderSettings = [[IMAAdsRenderingSettings alloc] init];renderSettings.webOpenerPresentingController = self;
UIView *videoContainerView = self.view;NSString *adTag = @"OUR_AD_TAG"; // This has been removed for this post. The ad tag is valid and returns an ad properly.
BCOVCuePointProgressPolicy *cuePointsPolicy = [BCOVCuePointProgressPolicy progressPolicyProcessingCuePoints:BCOVProgressPolicyProcessAllCuePoints resumingPlaybackFrom:BCOVProgressPolicyResumeFromContentPlayhead ignoringPreviouslyProcessedCuePoints:NO];BCOVIMAAdsRequestPolicy *adsRequestPolicy = [BCOVIMAAdsRequestPolicy adsRequestPolicyWithVASTAdTagsInCuePointsAndAdsCuePointProgressPolicy:cuePointsPolicy];
self.controller = [manager createIMAPlaybackControllerWithSettings:imaSettings adsRenderingSettings:renderSettings adsRequestPolicy:adsRequestPolicy adContainer:videoContainerView companionSlots:nil viewStrategy:nil];
[self.controller setVideos:@[[self videoWithURL:self.videoURL adTag:adTag]]];[self.controller setDelegate:self];
[self.controller play];Error logging from Xcode:
libc++abi: terminating with uncaught exception of type NSException terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<IMAAdViewController: 0x12fe2a950> should have parent view controller:<UIViewController: 0x12d515c60> but actual parent is:<UIViewController: 0x108417780>'
1. Navigate to
https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002p1jDlQAI&entry.80707362=002003022. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
![]() |
IMA SDK Team |