Your Digital Media Has Never Looked So Good

 
User avatar
RokuNB
Topic Author
Posts: 459
Joined: Fri Mar 31, 2017 2:22 pm

RAF 2.0: Native integration of ads in RSG apps

Fri Mar 31, 2017 6:51 pm

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.
 
renojim
** Valued Community Member **
Posts: 3481
Joined: Mon Feb 15, 2010 1:35 pm

Re: RAF 2.0: Native integration of ads in RSG apps

Sat Apr 01, 2017 11:31 am

Welcome, RokuNB! ;)
 
tim_beynart
Posts: 227
Joined: Wed Jul 15, 2015 8:30 am

Re: RAF 2.0: Native integration of ads in RSG apps

Thu Apr 13, 2017 10:54 am

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? 
 
User avatar
RokuNB
Topic Author
Posts: 459
Joined: Fri Mar 31, 2017 2:22 pm

Re: RAF 2.0: Native integration of ads in RSG apps

Thu Apr 13, 2017 11:22 pm

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.
 
malort
Posts: 57
Joined: Tue Jul 15, 2014 11:49 am

Re: RAF 2.0: Native integration of ads in RSG apps

Fri Apr 14, 2017 10:39 am

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.
 
User avatar
RokuNB
Topic Author
Posts: 459
Joined: Fri Mar 31, 2017 2:22 pm

Re: RAF 2.0: Native integration of ads in RSG apps

Fri Apr 14, 2017 10:48 am

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.
 
malort
Posts: 57
Joined: Tue Jul 15, 2014 11:49 am

Re: RAF 2.0: Native integration of ads in RSG apps

Fri Apr 14, 2017 10:53 am

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!
 
malort
Posts: 57
Joined: Tue Jul 15, 2014 11:49 am

Re: RAF 2.0: Native integration of ads in RSG apps

Fri Apr 14, 2017 11:58 am

diff --git a/components/Player.brs b/components/Player.brs
index e1eb65e..2a22701 100644
--- a/components/Player.brs
+++ b/components/Player.brs
@@ -9,7 +9,7 @@
 ' Player

 sub init()
-    m.video = m.top.CreateChild("Video")
+    m.video = m.top.findNode("VideoNode")
 end sub

 sub controlChanged()
diff --git a/components/Player.xml b/components/Player.xml
index 085c0fe..0efe222 100644
--- a/components/Player.xml
+++ b/components/Player.xml
@@ -13,5 +13,11 @@
         <field id="control" type="string" alwaysNotify="true" onChange="controlChanged"/>
     </interface>

+    <children>
+      <Rectangle id="VideoViewPort" width="480" height="270" translation="[100,100]" clippingRect="[0,0,480,270]">
+        <Video id="VideoNode" width="480" height="270"/>
+      </Rectangle>
+    </children>
+
     <script type="text/brightscript" uri="pkg:/components/Player.brs" />
 </component>

RokuNB, see the small diff above to make the videoNode a child of a rectangle. The ad will now play based on the translation, but it doesn't inherit the width/height. I added clippingRect after the fact just to see it sized properly, but that just clips it. I noticed that the boundingRect is still 1280x720. Is there a key to changing the bounding rect that's separate from setting the width/height? 
Here is a quick log from RAF renderer during playback, note the bounding rect.
rafrndr-renderTypeChanged() - client-inserted
added child: Rectangle id: 1 subtype: Rectangle
parent bounding rect: x:  100  y:  100  w:  1280  h:  721

Forgot to include the "view" boundingRect. This is the view being passed to showAds, and it indicates the width/height are set correctly.
?view.boundingrect()
<Component: roAssociativeArray> =
{
    height: 270
    width: 480
    x: 100
    y: 100
}
 
tim_beynart
Posts: 227
Joined: Wed Jul 15, 2015 8:30 am

Re: RAF 2.0: Native integration of ads in RSG apps

Tue Apr 18, 2017 2:17 pm

Thanks for the response! However, I am stumped by Neilsen. In the documentation, I see this:
2. Nielsen Digital Ad Ratings Requirements

For server side ad inserted applications, call [color=#3572b0]fireTrackingEvents() 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
 
Techie
Posts: 5
Joined: Tue Mar 07, 2017 12:45 pm

Re: RAF 2.0: Native integration of ads in RSG apps

Wed Aug 02, 2017 3:11 pm

Were you able to set the width and height of the raf ads?
 
bryandunbar42
Posts: 6
Joined: Fri Feb 23, 2018 10:19 am

Re: RAF 2.0: Native integration of ads in RSG apps

Tue Feb 19, 2019 1:54 pm

Was anybody ever able to get RAF to play ads smaller than full screen?
 
User avatar
RokuNB
Topic Author
Posts: 459
Joined: Fri Mar 31, 2017 2:22 pm

Re: RAF 2.0: Native integration of ads in RSG apps

Wed Feb 20, 2019 4:48 pm

bryandunbar42 wrote:
Was anybody ever able to get RAF to play ads smaller than full screen?

Yes, it works

Who is online

Users browsing this forum: No registered users and 8 guests