Roku Developer Program

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

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
joetesta
Level 10

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
Level 7

Re: SceneGraph URL backup

Thanks for the info. Now if I just knew how to do that Smiley Sad
0 Kudos
Highlighted
matrixebiz
Level 7

Re: SceneGraph URL backup

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