iOS pre-rolls delayed until video loads

225 views
Skip to first unread message

Patrick Weekes

unread,
Sep 21, 2015, 1:20:20 PM9/21/15
to Interactive Media Ads SDK
Using the iOS SDK, when trying to show a preroll before the video there is a huge delay while the video loads, then plays 1 frame before the pre-roll ad starts.

Ideally, the ad would play right away, then after it finishes, the video would start to load. This appears to be the behaviour with the Android SDK.

Here is my code for creating the video / cue point.

- (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:@{}];

}



And for creating the controller:
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];

Is there any way to get this pre-roll to play before loading the ad?

Tyler Sidell (IMA SDK Team)

unread,
Sep 21, 2015, 5:10:21 PM9/21/15
to Interactive Media Ads SDK
Hi Patrick,

Thank you for supplying snippets of your code.  

We have Best Practices that help to reduce latency that you may want to try implementing. I would suggest that you initialize the IMA SDK, request and parse your ads response before your user even clicks play on your video. By default, the adsLoader gets loaded once a user action, such as a tap, has been detected so initializing it right away will help reduce the latency.

Another approach that you can use is manual ad break playback, which will allow you to have control over when to play an ad.  This would help your particular use case as you could tell the player to play an ad independently of the video content itself and not have to wait for the content to finish loading.

Also, it looks like you are using Brightcove's player with an implementation of the IMA SDK so as a suggestion you can reach out to the Brightcove Native Player SDKs forum to get additional solutions.

Thanks,
Tyler Sidell
IMA SDK Team

Amit Kumar

unread,
Mar 18, 2016, 12:59:30 PM3/18/16
to Interactive Media Ads SDK
Hi,

can we preload the ad and store it before playing it.

Thx
Amit

Tyler Sidell (IMA SDK Team)

unread,
Mar 18, 2016, 4:37:03 PM3/18/16
to Interactive Media Ads SDK
Hi Amit,

Currently, we cannot preload the ad before playing it.  Our reduce latency section provides best practices to load your resources for the SDK itself.  

Thanks,
Tyler Sidell
IMA SDK Team

Manoj Alwis

unread,
Sep 27, 2023, 6:26:44 AM9/27/23
to Interactive Media Ads SDK
I've been actively working on integrating react-native-brightcove-player into our React Native app. However, after upgrading the React Native version to 0.67, we encountered a critical issue on the iOS side. Specifically, the app crashes when attempting to use the Brightcove player.

I would greatly appreciate it if someone with experience in addressing this particular error could provide some guidance or advice. Your assistance would be invaluable. Thank you.



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>' 

IMA SDK

unread,
Sep 27, 2023, 8:52:30 AM9/27/23
to happynewz...@gmail.com, ima...@googlegroups.com
Hi Manoj,

In order for us to check your concern further, could you kindly share the following?
  • Full stack trace of the crash log
  • Screen recording capturing the reported crash
  • Sample project where the issue is reproducible
Please provide us to us using the steps below.

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=00200302

2. 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.


 
This message is in relation to case "ref:_00D1U1174p._5004Q2p1jDl:ref"

Thanks,
 
Google Logo IMA SDK Team


 

Reply all
Reply to author
Forward
0 new messages