ccaines
10 years agoBinge Watcher
RAF - Multiple Pre Roll Ads Can it be Done??
I want to schedule multiple ads within my pre-roll ad break. Nobody has told me that this can't be done but I'm almost convinced that this is impossible using only the Roku ad library and NOT implementing the more complicated VAST xml method.
I have successfully created an adpod object that passes 2 ads to showads() using the proper ad structure as defined in the RAF documents. My solutions works with 1 ad in the adpod but creates an error when I create an adpod with 2 or more. Here is the output:
Roku_Ads Framework version 1.6
Roku_Ads_checkAllowedFeature: Parsing whitelist for ROKU_ADS_NIELSEN_ID
Roku_Ads_util_getStringFromUrl: requesting URL: http://pubads.g.doubleclick.net/gampad/ ... 4062A%2529
Roku_Ads_util_getStringFromUrl: requesting URL: http://rtr.innovid.com/r1.5706a8ed7a453 ... =268608114
Ad 1 id: 1h6n1m
Roku_Ads_util_getStringFromUrl: requesting URL: http://pubads.g.doubleclick.net/gampad/ ... 4062A%2529
Roku_Ads_util_getStringFromUrl: requesting URL: https://rtr.innovid.com/r1.57461984b812 ... =778819289
Ad 2 id: 1h46c5
<Component: roAssociativeArray> =
{
ads: <Component: roArray>
duration: 60
rendersequence: preroll
rendertime: 0
viewed: false
}
Ad count: 2
RAF 1.6; rendering preroll pod of 2 ads
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Current Function:
3264: ??
3265: ??
3266: ??
3267: ??
3268: ??
3269: ??
3270: ??
3271: ??
3272:* ??
3273: ??
3274: ??
3275: ??
3276: ??
Syntax Error. (runtime error &h02) in roku_ads_lib:/Roku_Ads.brs(3272)
3272: ??
Here is the code (after I set all the RAF params):
What am I doing wrong??
I have successfully created an adpod object that passes 2 ads to showads() using the proper ad structure as defined in the RAF documents. My solutions works with 1 ad in the adpod but creates an error when I create an adpod with 2 or more. Here is the output:
Roku_Ads Framework version 1.6
Roku_Ads_checkAllowedFeature: Parsing whitelist for ROKU_ADS_NIELSEN_ID
Roku_Ads_util_getStringFromUrl: requesting URL: http://pubads.g.doubleclick.net/gampad/ ... 4062A%2529
Roku_Ads_util_getStringFromUrl: requesting URL: http://rtr.innovid.com/r1.5706a8ed7a453 ... =268608114
Ad 1 id: 1h6n1m
Roku_Ads_util_getStringFromUrl: requesting URL: http://pubads.g.doubleclick.net/gampad/ ... 4062A%2529
Roku_Ads_util_getStringFromUrl: requesting URL: https://rtr.innovid.com/r1.57461984b812 ... =778819289
Ad 2 id: 1h46c5
<Component: roAssociativeArray> =
{
ads: <Component: roArray>
duration: 60
rendersequence: preroll
rendertime: 0
viewed: false
}
Ad count: 2
RAF 1.6; rendering preroll pod of 2 ads
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Current Function:
3264: ??
3265: ??
3266: ??
3267: ??
3268: ??
3269: ??
3270: ??
3271: ??
3272:* ??
3273: ??
3274: ??
3275: ??
3276: ??
Syntax Error. (runtime error &h02) in roku_ads_lib:/Roku_Ads.brs(3272)
3272: ??
Here is the code (after I set all the RAF params):
preRollAds = []
adBreakIndex = 0
x=0
id =[]
id.Push("")
thisAd = []
a = []
duration = 0
for ads = 1 to n
gettingAd = true
while gettingAd
msg = wait(0, screen.GetMessagePort())
adPods = adIface.getAds(msg)
thisAd = adPods[0].ads
if fnIsUnique(id, thisAd[0].adid)
print "Ad "+itostr(x+1)+" id: "+thisAd[0].adid
id.Push(thisAd[0].adid)
a.Push(adPods[0].ads)
duration = duration+adPods[0].duration
gettingAd = false
endif
end while
x=x+1
end for
preRollAds = {viewed : false,
renderSequence : "preroll",
duration : duration,
renderTime : 0
ads:a
}
Print(preRollAds.ads)
? "Ad count: "+itostr(preRollAds.ads.count())
adIface.showAds(preRollAds)
What am I doing wrong??