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: 
SolveLLC
Visitor

RAF and ad pods

Due to a limitation of our ad server and having multiple demand partners......

Is there a way to tell RAF to play X number of ads regardless of how many are returned in the pod?  For example if the pod returns 5 and we want to play 3.

Where does this come from if debug is set "RAF.showAds(); rendering preroll pod of 5 ads"
0 Kudos
4 REPLIES 4
RokuNB
Roku Guru

Re: RAF and ad pods

It's a RAF diagnostic. raf.showAds() plays all the ads that it is given, it does not do any selection.

raf.getAds(posn_msg) does select/return a pod from previously parsed pods coming from VMAP/SMRX but this does not seem to be your case.
For your case, i think you'll have to modify the ad-break structure prior to passing it to showAds(), so that it has the number of ads you desire. Rather simple to do. Check the data structure in RAF doco. Or dump it to console with "print formatJSON(ads)", format that in JSON pretty-printer and examine.
0 Kudos
SolveLLC
Visitor

Re: RAF and ad pods

"RokuNB" wrote:
It's a RAF diagnostic. raf.showAds() plays all the ads that it is given, it does not do any selection.

raf.getAds(posn_msg) does select/return a pod from previously parsed pods coming from VMAP/SMRX but this does not seem to be your case.
For your case, i think you'll have to modify the ad-break structure prior to passing it to showAds(), so that it has the number of ads you desire. Rather simple to do. Check the data structure in RAF doco. Or dump it to console with "print formatJSON(ads)", format that in JSON pretty-printer and examine.

Is there a method to return how many valid ads were parsed from getAds?
0 Kudos
RokuNB
Roku Guru

Re: RAF and ad pods

"SolveLLC" wrote:
Is there a method to return how many valid ads were parsed from getAds?

getAds() returns an array of pods in this format (though i find it easier to dump formatJSON() and work on example, what i recommended), so just taking .count() of that will give you the number of pods. To count the ads per pod, you'll have to drill down a little deeper. But if i recollect, only the valid ads are retained per pod (the slots remaining empty are dropped).
0 Kudos
SolveLLC
Visitor

Re: RAF and ad pods

"RokuNB" wrote:
"SolveLLC" wrote:
Is there a method to return how many valid ads were parsed from getAds?

getAds() returns an array of pods in this format (though i find it easier to dump formatJSON() and work on example, what i recommended), so just taking .count() of that will give you the number of pods. To count the ads per pod, you'll have to drill down a little deeper. But if i recollect, only the valid ads are retained per pod (the slots remaining empty are dropped).

Thanks!
0 Kudos