Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

RAF givng "Problem displaying MediaFile"

I can get the FullRAFSeceneGraphSample project working and showing ads correctly.  When I integrate the code into my Scene Graph app I get the following error when trying to play the ad.  The black screen with "Your program will begin after thsi message" shows but it just freezes on this screen.  No progres bar at the bottom showing ad loading progress either.

I had this all working in my app but all of a sudden it stopped. I can't figure out what change I made broke the pre-roll ads via RAF.  Here is my debug output.  Firmware ver 7.5 is what I'm on

Roku_Ads Framework version 1.9
Roku_Ads library version: 1.9
[size=100]Roku_Ads_util_getStringFromUrl: requesting URL:;_fw_ae=d8b58f7bfce28eefcc1cdd5b95c3b663;app_id=ROKU_ADS_APP_ID[/size]
Roku_Ads_util_getStringFromUrl: requesting URL:
m56s14 [PlayAd] adPods.count:  1
RAF 1.9; rendering preroll pod of 1 ads
Roku_Ads_showVideoAd: isRequestFailed(): index = 0; message = failed to create media player
RAF 1.9; render failure: failed to create media player
m56s14 [PlayAd] Error. Obj: invalid ][ Error ][ <Component: roAssociativeArray> =
    ad: <Component: roAssociativeArray>
    adindex: 1
    duration: 30
    errcode: "405"
    errmsg: "Problem displaying MediaFile"
    type: "Error"
Roku_Ads_util_getNoResponseFromUrl: requesting URL:

Any idea why this would happen?
0 Kudos
4 Replies
Level 7

Re: RAF givng "Problem displaying MediaFile"

I figured out the issue.  Problem was I'm setting the video.control state to "prebuffer" before calling raf.showAds(adPods)

When RAF tries to render the ad it thinks that a video is already playing.

How can I pre-buffer my video while the ad is playing? 
0 Kudos
Level 10

Re: RAF givng "Problem displaying MediaFile"

Am i getting this right - you are using RSG (scenography) for your main UI, plus RAF in the main thread - so it's essentially "hybrid" mode, right? And if you set "prebuffer" for roSgNode Video, somehow through quantum entanglement (Einstein's "Spooky Action at a Distance") that (d)effects the RAF play??

How very interesting!
0 Kudos
Level 7

Re: RAF givng "Problem displaying MediaFile"

You used a few acronyms there that I'm not familiar with. I am using a scene graph application with a RowList element.  When an item in that RowList is hovered over, I set the Video element's "control" state to "prebuffer".

When a user clicks (OK) on the RowList element my main thread gets a message on its port, and kicks off a raf.showAds(adPods).  This causes RAF to throw a "Problem displaying MediaFile" error.

If I remove setting the video state to prebuffer before playing the ad, everything works fine.  I think the issue is the prebuffer holds up control of the video player, not allowing RAF to invoke it.

I want to prebuffer while on hover AND continue to prebuffer while the ad is playing.
0 Kudos
Level 10

Re: RAF givng "Problem displaying MediaFile"

Right, i went all jargony on you - sorry!

RSG = "Roku Scene Graph", which i shorten to "scenography" to be a pronounceable word.

By "hybrid" i meant mix of SDK1 (roVideoPlayer, roVideoScreen in main thread) and SDK2 (roSgScreen and roSgNode subclasses like RowList and Video, render thread). And yes, from what i remember RAF is entirely SDK1 affair.

And by "spooky action at a distance" i mean that 2 completely separate objects - in separate threads even - affecting each other. We had a thread on that a few months ago - and my understanding is that
[spoiler=there can be only one:1b1s7scz][youtube:1b1s7scz]sqcLjcSloXs[/youtube:1b1s7scz][/spoiler:1b1s7scz] video player per Roku. Yes, behind the Roku scene there is a singleton media player and if that gets "wedged", bad things happen - incl. device reboots.

So i am not optimistic about being able to do both in parallel. But let's see what Roku* says?
0 Kudos