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)
<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="2.0">
<Ad id="214948109">
<Wrapper>
<AdSystem>GDFP</AdSystem>
<VASTAdTagURI><![CDATA[http://rtr.innovid.com/r1.5717d5a4b3ce01.76059343;cb=1145840923]]></VASTAdTagURI>
<Error><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=videoplayfailed]]></Error>
<Impression><![CDATA[http://pubads.g.doubleclick.net/pagead/adview?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=JyScuYMY8uk&cid=CAASEuRoxm2BLChsengE_Un6nvjhKA]]></Impression>
<Creatives>
<Creative id="105498044789" sequence="1">
<Linear>
<TrackingEvents>
<Tracking event="start"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=part2viewed&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="start"><![CDATA[http://secure-gl.imrworldwide.com/cgi-bin/m?ci=nlsnci1087&am=4&at=view&rt=banner&st=image&ca=nlsn37085&cr=crtve&pc=ROKU_ADS_APP_ID&ce=roku&r=1145840923]]></Tracking>
<Tracking event="start"><![CDATA[https://p.ads.roku.com/pixelServer/p.html?&meType=1&evType=0&deType=ROKU_ADS_DEVICE_MODEL&chID=ROKU_ADS_APP_ID&cID=492173669&pIID=214948109&crID=105498044789&deID=ROKU_ADS_TRACKING_ID&tStamp=ROKU_ADS_TIMESTAMP&extIP=ROKU_ADS_EXTERNAL_IP]]></Tracking>
<Tracking event="firstQuartile"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=videoplaytime25&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="midpoint"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=videoplaytime50&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="thirdQuartile"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=videoplaytime75&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="complete"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=videoplaytime100&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="mute"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=admute&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="unmute"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=adunmute&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="rewind"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=adrewind&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="pause"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=adpause&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="resume"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=adresume&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="fullscreen"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=adfullscreen&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="creativeView"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=vast_creativeview&ad_mt=[AD_MT]]]></Tracking>
<Tracking event="acceptInvitation"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=acceptinvitation]]></Tracking>
<Tracking event="start"><![CDATA[http://video-ad-stats.googlesyndication.com/video/client_events?event=2&web_property=ca-pub-7650175200946213&cpn=[CPN]&break_type=[BREAK_TYPE]&slot_pos=[SLOT_POS]&ad_id=[AD_ID]&ad_sys=[AD_SYS]&ad_len=[AD_LEN]&p_w=[P_W]&p_h=[P_H]&mt=[MT]&rwt=[RWT]&wt=[WT]&sdkv=[SDKV]&vol=[VOL]&content_v=[CONTENT_V]&conn=[CONN]&format=[FORMAT_NAMESPACE]_[FORMAT_TYPE]_[FORMAT_SUBTYPE]]]></Tracking>
<Tracking event="complete"><![CDATA[http://video-ad-stats.googlesyndication.com/video/client_events?event=3&web_property=ca-pub-7650175200946213&cpn=[CPN]&break_type=[BREAK_TYPE]&slot_pos=[SLOT_POS]&ad_id=[AD_ID]&ad_sys=[AD_SYS]&ad_len=[AD_LEN]&p_w=[P_W]&p_h=[P_H]&mt=[MT]&rwt=[RWT]&wt=[WT]&sdkv=[SDKV]&vol=[VOL]&content_v=[CONTENT_V]&conn=[CONN]&format=[FORMAT_NAMESPACE]_[FORMAT_TYPE]_[FORMAT_SUBTYPE]]]></Tracking>
</TrackingEvents>
<VideoClicks>
<ClickTracking id=""><![CDATA[http://video-ad-stats.googlesyndication.com/video/client_events?event=6&web_property=ca-pub-7650175200946213&cpn=[CPN]&break_type=[BREAK_TYPE]&slot_pos=[SLOT_POS]&ad_id=[AD_ID]&ad_sys=[AD_SYS]&ad_len=[AD_LEN]&p_w=[P_W]&p_h=[P_H]&mt=[MT]&rwt=[RWT]&wt=[WT]&sdkv=[SDKV]&vol=[VOL]&content_v=[CONTENT_V]&conn=[CONN]&format=[FORMAT_NAMESPACE]_[FORMAT_TYPE]_[FORMAT_SUBTYPE]]]></ClickTracking>
<ClickTracking id="GDFP"><![CDATA[http://pubads.g.doubleclick.net/pcs/click?xai=AKAOjsuN7K9bRc2M0Y0RsGgSwIlvF6fVDFpmYewuF5dit0Mn231mK_2py9vIVZln3PR8nbY4jM41JWKWZC1j2HcZ51nOr7B7ogjZvQTBLPJmEniiqpM9X3KFA9CnWC7alosz4XHwpREPbdUYCEung40kEweC9dZrga3f32dJMOit40bdYdSYT2ni7K5EZriPH4F6&sai=AMfl-YRzFQDtS0aWXYUI_YdP4mLRn_3cDw1_5jSIE86WhxwYSroeOXUHr3IMQxe-rwIUW81Ru1BV113ODa56aE_gHfqm1r8jP4NcJFY0ESK15jpr0Q&sig=Cg0ArKJSzFQ3h8wqePU7EAE&urlfix=1]]></ClickTracking>
</VideoClicks>
</Linear>
</Creative>
</Creatives>
<Extensions>
<Extension type="activeview"><CustomTracking>
<Tracking event="viewable_impression"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=viewable_impression&acvw=[VIEWABILITY]&gv=[GOOGLE_VIEWABILITY]]]></Tracking>
<Tracking event="abandon"><![CDATA[http://pubads.g.doubleclick.net/pagead/conversion/?ai=BUbwd4DVYV-KKHoWB-gOWuoGgCZ3t4pAJAAAAEAEgvfnFJTgAWPXSsYGJA2DJtoCHyKP8GrIBCHJva3UuY29tugENMTkyMHgxMDgwX3htbMgBBdoBEGh0dHA6Ly9yb2t1LmNvbS-YArzmAcACAuACAOoCFy84MjExNDI2OS9ycmFmY3MvcnIvZGV2-ALw0R6QA6wCmAPgA6gDAeAEAdIFBRCNsr9mkAYBoAYk2AcA4AcL&sigh=qMnyFiVB0F4&label=video_abandon&acvw=[VIEWABILITY]&gv=[GOOGLE_VIEWABILITY]]]></Tracking>
</CustomTracking>
</Extension>
<Extension type="geo"><Country>US</Country>
<Bandwidth>0</Bandwidth>
</Extension>
</Extensions>
</Wrapper>
</Ad>
</VAST>
You can definitely package multiple ads in one pod.
then I add an array of ads to the pod.
preRollAds = []
a = []
duration = 0
for ads = 1 to n
adPods = adIface.getAds()
thisPod = adPods[0].ads
for each ad in thisPod
a.Push(ad)
end for
end for
preRollAds = {viewed : false,
renderSequence : "preroll",
duration : duration,
renderTime : 0
ads : a
}
playContent = adIface.showAds(preRollAds)