There's sample code in the
documentation.
Calling getAds() in a while Loop::
while shouldPlayContent
videoMsg = wait(0, contentVideoScreen.GetMessagePort())
adPods = adIface.getAds(videoMsg)
if adPods <> invalid and adPods.Count() > 0
contentVideoScreen.Close() ' stop playback of content
shouldPlayContent = adIface.showAds(adPods) ' render current ad pod
if shouldPlayContent
' *** Insert client app’s resume-playback code here
end if
end if
' *** Insert client app’s video event handler code here
end while
It looks like you have to close the video screen and recreate it.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.