I am currently using Roku Advertising Framework (RAF) to show Ads. I used example and successfully connected with VAST server but at this moment I have Preroll ads only.
How can I modify or what are possibilities to read adBreaks and trigger player to show Ads in that certain moment?
sub PlayContentWithAds()
parentNode = m.top.GetParent()
content = m.top.content
m.top.lastIndex = m.top.startIndex
RAF = Roku_Ads()
RAF.enableAdMeasurements(true)
adServer = "https://example.adserver.com/vast.xml"
RAF.SetAdUrl(adServer)
keepPlay = true
index = m.top.startIndex - 1
itemsCount = items.Count()
adBreaks = ["00:00:00", "00:01:00", "00:02:00"]
while keepPlay
' check if playlist isn't complete
if itemsCount - 1 > index
parentNode.SetFocus(true)
index ++
item = items[index] ' contentNode of the video which should be played next
RAF.SetContentId(item.id)
if item.categories <> invalid
RAF.SetContentGenre("Lifestyle")
end if
RAF.SetContentLength(int(item.length)) ' in seconds
RAF.SetDebugOutput(false) 'for debug purpose
adPods = RAF.GetAds() ' ads retrieving
m.top.lastIndex = index ' save the index of last played item to navigate to appropriate detailsScreen
csasStream = RAF.constructStitchedStream(item, adPods)
keepPlay = RAF.renderStitchedStream(csasStream, parentNode)
else
keepPlay = false
end if
end while
end sub