Forum Discussion

NB_'s avatar
NB_
Roku Guru
9 years ago

RAF 2.0: Native integration of ads in RSG apps

A new version of RAF (Roku Ad Framework) - 2.0 - has been out for a month.
The major new feature is the library's native support of RSG,
more detail in this blog post https://blog.roku.com/developer/2017/03 ... g-raf-2-0/

A minimal sample demonstrating the new way of use can be found at https://github.com/rokudev/RAF4RSG-sample
See also the release notes

Your questions and comments are welcome - please post as reply below.

13 Replies

  • I am integrating RAF for apps that use server side ad insertion. Once I provide the ad data structure to RAF using importAds(), am I then required to manually call fireTrackingEvents() for each beacon event? 
  • "tim_beynart" wrote:
    I am integrating RAF for apps that use server side ad insertion. Once I provide the ad data structure to RAF using importAds(), am I then required to manually call fireTrackingEvents() for each beacon event? 

    No - see at the end of "Requirements for Server Side Ad Insertion" section in the documentation.

    In short, you import them with `raf.stitchedAdsInit(adPods)` and then during play periodically call `raf.stitchedAdHandledEvent(msg, player)` with messages (e.g. position) from the player.

    Umm, and if you are playing the stitched content in a Video node, then there is a caveat (the documentation needs update): When doing stitchedAdHandledEvent() for native RSG integration, the 2nd param `player` should be:
    { sgNode: video, port: port }

    where sgNode is the Video (or subclass thereof) node that is playing the stitched content
    and port is a roMessagePort observing the position and state attributes of said sgNode.
  • Is it possible to play the ads in a smaller window. e.g. we'd have a video node playing content while the user can browse the UI. This works, however once we plug RAF into the mix, it will play the add full screen. We tested using the sample you've provided and it functions the same way. You can set the the width and height in the Player.brs file to a smaller window, but the ads still play fullscreen.
  • "malort" wrote:
    Is it possible to play the ads in a smaller window. e.g. we'd have a video node playing content while the user can browse the UI. This works, however once we plug RAF into the mix, it will play the add full screen. We tested using the sample you've provided and it functions the same way. You can set the the width and height in the Player.brs file to a smaller window, but the ads still play fullscreen.

    I assume you are calling `showAds()` with the 3rd parameter View. Is that "properly-sized" to the part of the screen you want? I believe it's geometry is used to trim the play, as viewport.
  • "RokuNB" wrote:
    "malort" wrote:
    Is it possible to play the ads in a smaller window. e.g. we'd have a video node playing content while the user can browse the UI. This works, however once we plug RAF into the mix, it will play the add full screen. We tested using the sample you've provided and it functions the same way. You can set the the width and height in the Player.brs file to a smaller window, but the ads still play fullscreen.

    I assume you are calling `showAds()` with the 3rd parameter View. Is that "properly-sized" to the part of the screen you want? I believe it's geometry is used to trim the play, as viewport.

    I just realized that the RAF integration (showAds) creates another player in the "view" (renderable node), it doesn't actually use the video node we have created. I'll look into resizing that renderable node and not the player itself. Thanks for the quick response!
  • Thanks for the response! However, I am stumped by Neilsen. In the documentation, I see this:
    2. Nielsen Digital Ad Ratings Requirements

    fireTrackingEvents()[/url:3vpg8rm1] in RAF and ensure that the Nielsen beacons are passed to RAF via that API. It is valid to pass all impression beacons to RAF via this API. For non-Nielsen beacons, RAF will be just a pass-through. [/color]

    I am not sure what this means. I thought the Neislen-specific methods in RAF took care of all this? How specifically do I "ensure that the Nielsen beacons are passed to RAF"? Right now I see all the beacons from my ad server in Charles, but I don't see any calls to Neilsen. 
    I implemented it this way (heavily edited):

    ha ha never mind, I see the beacons in Charles. I was looking for the wrong domain, oops.
    For anyone else trying to debug neilsen, the domain is imrworldwide
  • Were you able to set the width and height of the raf ads?
  • "bryandunbar42" wrote:
    Was anybody ever able to get RAF to play ads smaller than full screen?

    Yes, it works
    • tvapps's avatar
      tvapps
      Reel Rookie

      Can you post an example how to show the ad smaller than full screen?  I've tried the one in this thread and it doesn't resize the video, it just moves it.

      • speechles's avatar
        speechles
        Roku Guru

        Can't you just wrap the video node with a group then use scale on that group to shrink the video node? Set the scale to 0.25 to get 1/4 the size then adjust the translation placement to get where you need to be.