Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
destruk
Binge Watcher

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?
0 Kudos
9 REPLIES 9
RokuNB
Roku Guru

Re: RAF Ad Counter Display?

you don't. it's an ad badge to clearly distinguish ads from content
0 Kudos
destruk
Binge Watcher

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. 

0 Kudos
RokuNB
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?

 

destruk
Binge Watcher

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.

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.

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