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: 
acreskey
Visitor

RAF.setAdUrl with package file

Hi,

Trying to set RAF.setAdUrl() with a local file (VMAP) but it's crashing inside RAF.
i.e.
#5  Function roku_ads_parser_parse(xmldata_ As String, adserver_ As String) As Object
   file/line: roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)


This is what I'm doing:
Note that the test of ReadAsciiFile() succeeds and outputs the file correctly.
file = "pkg:/config/ads.xml"

' test: succeeds
adXML = ReadAsciiFile(file)
? adXML

' crashes RAF
adInterface.setAdUrl(file)


The captured VMAP had been read processed by RAF previously, when retrieved via HTTP.
Any ideas?
0 Kudos
5 REPLIES 5
NB_
Roku Guru

Re: RAF.setAdUrl with package file

Tell me the firmware version, model #, RAF version.
Also give me a detailed error message, including the full stack (not only #5) and the exact error message (in other words copy&paste more context from the console). Showing the VMAP file may help too.
0 Kudos
acreskey
Visitor

Re: RAF.setAdUrl with package file

Sorry, this issue was "user error" on my part. The VMAP xml I used didn't parse.

However as a possible improvement the error-handling in the RAF VMAP parser could be improved to not crash 🙂

These are the logs:
Roku_Ads Framework version 2.0108


Roku_Ads_util_getStringFromUrl: requesting URL: pkg:/config/ads.xml

Suspending threads...
Thread selected:  1*   ...ib:/Roku_Ads_VAST_Parser.brs(190)    ??

Current Function:
182:  ??
183:  ??
184:  ??
185:  ??
186:  ??
187:  ??
188:  ??
189:  ??
190:* ??
191:  ??
Use of uninitialized variable. (runtime error &he9) in roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)
190: ??
Backtrace:
#5  Function roku_ads_parser_parse(xmldata_ As String, adserver_ As String) As Object
   file/line: roku_ads_lib:/Roku_Ads_VAST_Parser.brs(190)
#4  Function roku_ads_getads() As Dynamic
   file/line: roku_ads_lib:/Roku_Ads.brs(3966)

Local Variables:
No variable info.
Threads:
ID    Location                                Source Code

 1*   ...ib:/Roku_Ads_VAST_Parser.brs(190)    ??
  *selected
0 Kudos
NB_
Roku Guru

Re: RAF.setAdUrl with package file

"acreskey" wrote:
However as a possible improvement the error-handling in the RAF VMAP parser could be improved to not crash 🙂

Absolutely. I just saw where the issue is and we'll plug it - thank you for the report and the details!
0 Kudos
NB_
Roku Guru

Re: RAF.setAdUrl with package file

And done - RAF 2.2 is out.
0 Kudos
acreskey
Visitor

Re: RAF.setAdUrl with package file

"RokuNB" wrote:
And done - RAF 2.2 is out.

Nice!
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.