Apps that display video ads need a custom Roku Ad Framework (RAF) integration. RAF is a Roku library that handle ad UI, tracks ads, fires beacons, and so on. Both server-side and client-side ads are supported. RAF integration can be complex. Typically, it deals little with the Cloud Solution and almost exclusively with BrightScript, Roku and ad provider elements.
The following describes typical operation:
Roku may require an additional channel certification process for channels with ads. This can include the injection of test ads to verify correct handling.
If your application uses the content drawer, it should not combine RAF ads and video into a playlist. If used, the content drawer will not return focus to the RAF video node, which will lead to inaccessible video controls.
Note the following:
adInterface.setDebugOutput(true). On slow devices, it that can cause playback delays.
SetAdPrefs()to disable the default behavior of using the Roku Ad Network for backfill ads.
The Cloud Solution includes a reference implementation of Auditudes. To use Auditudes, you need to:
Note If you want to implement other ads services, You.i TV recommends that your implementation follow a pattern similar to that used for Auditudes.
Define a property named
ads_class in the client manifest; for example:
If the property is not defined, the default
Ads handler is created and used.
Ads handler does not have any actual operation.
Currently, a client allows only one ads configuration.
Define XML client code such as the following:
<?xml version="1.0" encoding="utf-8" ?> <component name="AuditudeAds" extends="ContentNode"> <interface> <function name="initialize"/> <function name="initiatesPlayback"/> <function name="getPlayerTaskName"/> <function name="playVideo"/> </interface> <script type="text/brightscript" uri="pkg:/components/auditudeAds.brs"/> <script type="text/brightscript" uri="pkg:/source/nielsen.brs" /> <script type="text/brightscript" uri="pkg:/source/utils.brs" /> </component>
<Component name> entry in the XML must match with the
ads_class entry in the manifest.
It must also extend
The list of function interfaces can vary according to your actual ads implementation. It is called by ads task.
Add the name of the BrightScript file containing your implementation of the actual ads handler to the script section of the XML code.
In this example, the implementing file is