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: 
matrixebiz
Roku Guru

SceneGraph URL backup

Hello, with the SceneGraph channel we have to change the URL to our own file on line 22 but I was wondering how do I edit that so that if one link is down then to check another? Thanks
  'Variables for storing node selected and position
  m.node  = invalid
  m.array = invalid
  m.UriHandler  = createObject("roSGNode","UriHandler")
  url = "https://devtools.web.roku.com/videoplayer/xml/categories.xml" ' < ------ Line 22: URL to change to our own server
  makeRequest({}, url, "GET", 0, "")
  m.UriHandler.observeField("content","onContentSet")
  m.UriHandler.observeField("categorycontent","onCategoryContentSet")
  m.RegistryTask.observeField("result","onReadFinished")
0 Kudos
3 REPLIES 3
joetesta
Roku Guru

Re: SceneGraph URL backup

in the onError callback make a new request with the updated URL.  if you use the same callback for both, put a counter or flag to prevent an infinite loop in the event your backup URL is also erroring.

Looking at the project you're using, 
https://github.com/rokudev/videoplayer- ... andler.brs
there's no failure callback so you'd want to trigger this on line 166, which appears to happen after 3 failed attempts.
aspiring
0 Kudos
matrixebiz
Roku Guru

Re: SceneGraph URL backup

Thanks for the info. Now if I just knew how to do that 😞
0 Kudos
matrixebiz
Roku Guru

Re: SceneGraph URL backup

Some coding help here would be much appreciated. Thank you
0 Kudos