destruk
Streaming Star

RAF Ad Counter Display?

When there is just a single preroll ad for a video, how do you disable the "Ad 1 of 1" text in the top left corner with Roku Ad Framework in scenegraph?
Tags (1)
0 Kudos
9 REPLIES 9
NB_
Roku Guru

Re: RAF Ad Counter Display?

you don't. it's an ad badge to clearly distinguish ads from content
Tags (1)
0 Kudos
destruk
Streaming Star

Re: RAF Ad Counter Display?

Yup, that is the official endorsed solution.  You can't.  Otherwise just don't use RAF.  Much like if Roku doesn't allow you to do what you need to get done, just don't use Roku.  Makes perfect sense, and your support here is going way above and beyond what anyone had ever expected. 

Tags (1)
0 Kudos
NB_
Roku Guru

Re: RAF Ad Counter Display?

Distinguishing advertisements from content is paramount. 

Consistent experience across apps is important, including improvements to ad badge over time. 

Keeping this in mind, what do you imagine seeing when playing an ad break consisting of a single ad?

 

Tags (1)
destruk
Streaming Star

Re: RAF Ad Counter Display?

1 of 1 is implied if there isn't an ad counter.  It is stupid if you think about it, but nobody thinks about advertising.

Tags (1)
0 Kudos
Komag
Roku Guru

Re: RAF Ad Counter Display?

I can see how it would be implied, but people might appreciate knowing for sure, instead of wondering if there will be another ad after this one.

Tags (1)
oleksandr_L
Reel Rookie

Re: RAF Ad Counter Display?

You may just override RAF ShowAdCounter field.

Just like this:

Roku_Ads().ShowAdCounter = ShowAdCounterFunc

then you need to define a function:

function ShowAdCounterFunc(par1, par2)
    'do nothing
end function

 

0 Kudos
kirankumar3003
Reel Rookie

Re: RAF Ad Counter Display?

this is helpful. any idea what the parameters (par1 and par2) for ShowAdCounter represent?

0 Kudos
oleksandr_L
Reel Rookie

Re: RAF Ad Counter Display?

You could do something like this:

'use this before showAds()

Roku_Ads().ShowAdCounter = Handler().ShowAdCounter

function Handler()
    return {
        ShowAdCounter : function (par1, par2)
        ' set stop here and investigate what is inside


        ' add some code here to customize the labels
        ' par1.instance used for labels
        ' par2 - has time information about ads playing (index/total etc)
        end function
    }
end function

Note: add enough checking for 'invalid' value to do this code safe.

After debugging you will get enough information to customize labels, add any text, set color, fonts ...

I hope it will help

0 Kudos
stevediaz
Reel Rookie

Re: RAF Ad Counter Display?

To disable the "Ad 1 of 1" text in Roku Ad Framework (RAF) when there's only one preroll ad, you can check the ad count in your onAdEvent handler and hide the ad counter text node if the count is 1.

0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!