Search code examples
androidadsrokubrightscript

How to add skip button when roku ad is playing?


I am working on roku app using scene graph component. I am using RAF to show ads before video playing and this is working properly for me. My code is...

timestamp = CreateObject("roDateTime")
adUrl = "https://www.bowhunting.com/wp-content/themes/bowhunting/vmap.php?id=" + episode.ContentId + "&c=" + timestamp.AsSeconds().ToStr()

adIface = Roku_Ads()
adIface.setAdUrl(adUrl)
adPods = adIface.getAds()
shouldPlayContent = adIface.showAds(adPods)

I want to show a button like skip button in right-bottom corner. When user press on skip button, ad should be exit.

Is this possible to add this type of functionality when ad is playing?

Thank you


Solution

  • Users cannot genuinely press a "skip" button on the screen, because Roku has no pointer interface (mouse) nor touch screen. Nor does RAF provide for ways to integrate custom UI elements of yours with interactive ads (that have own buttons).

    They could however press the "Back" button on the remote and that by default exits the RAF ad play (that will result in you getting false returned by adIface.showAds(adPods)) - same desired result.