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: 
tim_beynart
Channel Surfer

Brightline ads broken in RAF 2.2 + Scenegraph?

I'm trying to test Brightline interactive ads in SceneGraph. Using RAF 2.0215 in firmware 7.7.0. I am using SSAI.
The ad doesn't render. I copied the Brightline ad pods from the  ServerStitchedAdSDK1Sample.zip  app from this page: https://sdkdocs.roku.com/display/sdkdoc/Integrating+the+Roku+Advertising+Framework#IntegratingtheRokuAdvertisingFramework-UseCases
(BTW I remember this example working fine, but sideloading that app now results in a RAF crash since I updated my firmware).
When I run my app with the following data, I see the two fake tracking events but never see a brightline event in the log, nor do I see an ad render.
Here's the mock ad data I am feeding in to RAF:
[
  {
  duration:30,
  pod_index:0,
  rendersequence:"preroll",
  rendertime:0,
  tracking:[
    {
      adSystems:"fw",
      event:"PodStart",
      time:0,
      url:"http://1-PODTRACK.FAKEURL.COM"
    },
    {
      adSystems:"Auditude",
      event:"PodStart",
      time:0,
      url:"http://2-PODTRACK.FAKEURL.COM"
    }
  ],
  "viewed":false,
  ads:[
      {
        adid:"20234435",
        advertiser:"",
        duration:30,
        rendertime:0,
        streamformat:"hls",
        streams:[],
        companionads: [
          {
            height: 720,
            mimetype: "application/json",
            tracking: [
              {
                event: "Impression",
                time: 0,
                triggered: false,
                url: "http://a.brightline.tv/?track=companion_impression&ad_id=001"
              },
              {
                event: "AcceptInvitation",
                triggered: false,
                url: "http://a.brightline.tv/?track=companion_accept_invitation&ad_id=001"
              }
            ],
            url: "https://a.brightline.tv/?id=ROKU_RAF_1&ver=%%SDK_VER%%&cb=%%CACHEBUSTER%%&mblist=2450X,2500X",
            width: 1280
          }],
        tracking:[
          {
            event:"Impression",
            time:0,
            triggered:false,
            url:"http://1-ADTRACK.FAKEURL.COM"
          },
          {
            event:"Impression",
            time:0,
            triggered:false,
            url:"http://2-ADTRACK.FAKEURL.COM"
          }
        ]
      }
    ]
  }
]
0 Kudos
10 REPLIES 10
RokuNB
Roku Guru

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

Couple of things - first, i see `streams` is empty - put there the URL to the (whole) stitched stream. Interactive companion check logic depends on it not being empty.
0 Kudos
tim_beynart
Channel Surfer

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

OK I'll try that, we've been ignoring that field and just load the video player directly once the stream URL is available.
0 Kudos
tim_beynart
Channel Surfer

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

adding the streams data results in an error:

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Suspending threads...
Thread selected:  1*   roku_ads_lib:/Roku_Ads.brs(3646)        ??

Current Function:
3646:* ??
3647:  ??
3648:  ??
3649:  ??
3650:  ??
Type Mismatch. (runtime error &h18) in roku_ads_lib:/Roku_Ads.brs(3646)
3646: ??
Backtrace:
#1  Function roku_ads_stitchedadsinit(adpodarray_ As Object) As Void
   file/line: roku_ads_lib:/Roku_Ads.brs(3647)
#0  Function onmediaurlchange(obj As Dynamic) As Void
   file/line: pkg:/components/cpc/tasks/raf.brs(54)
Local Variables:
No variable info.
Threads:
ID    Location                                Source Code
 0    pkg:/source/main.brs(16)                msg = wait(0, m.port)
 1*   roku_ads_lib:/Roku_Ads.brs(3646)        ??
 2[u] ??
  *selected   [u]unattached(not debuggable)

For the stream "url" field, I tried with the value from the demo app and the HLS manifest and both give me the same error. Here's the test pod:
ads:[
      {
        adid:"20234435",
        advertiser:"",
        duration:30,
        rendertime:0,
        streamformat: "brightline",
        streams: [
          {
            mimetype: "application/json",
            url: "https://a.brightline.tv/?id=ROKU_RAF_1&ver=%%SDK_VER%%&cb=%%CACHEBUSTER%%&mblist=2450X,2500X"
          }
        ],
        companionads: [
          {
            height: 720,
            mimetype: "application/json",
            tracking: [
              {
                event: "Impression",
                time: 0,
                triggered: false,
                url: "http://a.brightline.tv/?track=companion_impression&ad_id=001"
              },
              {
                event: "AcceptInvitation",
                triggered: false,
                url: "http://a.brightline.tv/?track=companion_accept_invitation&ad_id=001"
              }
            ],
            url: "https://a.brightline.tv/?id=ROKU_RAF_1&ver=%%SDK_VER%%&cb=%%CACHEBUSTER%%&mblist=2450X,2500X",
            width: 1280
          }],
        tracking:[
          {
            event:"Impression",
            time:0,
            triggered:false,
            url:"http://1-ADTRACK.FAKEURL.COM"
          },
          {
            event:"Impression",
            time:0,
            triggered:false,
            url:"http://2-ADTRACK.FAKEURL.COM"
          }
        ]
      }
    ]
0 Kudos
RokuNB
Roku Guru

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

Your pkg:/components/cpc/tasks/raf.brs(54) line is raf.stitchedAdsInit(), right?
By the nature of the error i am guessing you are passing wrong argument to stitchedAdsInit() - not a roArray and not even an Object. Not sure what it is instead (string? number?), just print it and it's type on the previous line.
0 Kudos
tim_beynart
Channel Surfer

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

Well, when I provide the array I posted originally, RAF works without errors (but Brightline companions are ignored/notworking). When I add the "streams" info, it throws the error. So something about the streams object is causing RAF to break.
0 Kudos
tim_beynart
Channel Surfer

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

oh boy, never mind, I was being an idiot and passing invalid to stitchedAdsInit. 
Now I see more activity in the log, but the Brightline ad does not render on screen.
Do I need to do something else with stitchedAdHandledEvent to make Brightline work?
here's the log entry:
rafrndr-renderTypeChanged() - server-stitched
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~ BRIGHTLINE.TV SG RENDERER for RAF ~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Roku_Ads library version: 2.0215
added child: Rectangle id: 1 subtype: Rectangle


Here's my event loop:
while m.playing
      msg = wait(0, port)
      curAd = invalid
      curAd = m.raf.stitchedAdHandledEvent(msg, {sgNode:m.videoplayer,port : port})
      '? "RAF cur ad >",curAd
      if curAd <> invalid
        'detect ad exit and nuke loop
        if curAd.adExited
          m.videoplayer.control="STOP"
          m.playing = false
          exit while
        else if curAd.adCompleted
          m.videoplayer.setFocus(true)
        end if
      else if msg.getField()="keypressed" and msg.getData()=0
        m.playing = false
        m.videoplayer.control="STOP"
        exit while
      end if
    end while
0 Kudos
RokuNB
Roku Guru

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

Are you playing the stitched stream in a Video node (vs. roVideoPlayer), then it's native-RSG mode?
Brightline don't have RSG-native renderer for SSAI in RAF 2.2, only Innovid does.
0 Kudos
tim_beynart
Channel Surfer

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

Well that explains it. I am using  Video node in RSG.
But that contradicts the release notes here: https://sdkdocs.roku.com/display/sdkdoc/Roku+Advertising+Framework#RokuAdvertisingFramework-Version2.2–07/2017
Added a native RSG renderer for Brightline interactive ads
0 Kudos
RokuNB
Roku Guru

Re: Brightline ads broken in RAF 2.2 + Scenegraph?

"tim_beynart" wrote:
Well that explains it. I am using  Video node in RSG.
But that contradicts the release notes here: https://sdkdocs.roku.com/display/sdkdoc/Roku+Advertising+Framework#RokuAdvertisingFramework-Version2.2–07/2017
Added a native RSG renderer for Brightline interactive ads


That only covers the CSAI (client-side ad insertion, traditional) case, i am afraid. Brightline interactives have worked (and still work) with SSAI + roVideoPlayer since before RAF 2.0. Just mentioning the options, pls no beatings...
0 Kudos