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

Re: Crash Course in SceneGraph available on GitHub

Here's a doc I put together for loading JSON in SG: https://gist.github.com/timbeynart-nbcuni/c73989ff347b101ef4176b8c104f82af#file-parse_json-brs-L15you will need to host the JSON file somewhere.

The crash course also expects you to host the JSON on a local server, the lesson is here: https://github.com/learnroku/crash-course/blob/master/docs/Lesson3.md
0 Kudos
mkdir1995
Visitor

Re: Crash Course in SceneGraph available on GitHub

"tim_beynart" wrote:
Here's a doc I put together for loading JSON in SG: https://gist.github.com/timbeynart-nbcuni/c73989ff347b101ef4176b8c104f82af#file-parse_json-brs-L15you will need to host the JSON file somewhere.

The crash course also expects you to host the JSON on a local server, the lesson is here: https://github.com/learnroku/crash-course/blob/master/docs/Lesson3.md

Hi Tim!
The github example for loading JSON is *extremely* helpful. Thank you so much. Is the code intended to display an actual grid, or just retrieve the data? (I have no errors, the JSON loads but the screen is gray).
0 Kudos
tim_beynart
Channel Surfer

Re: Crash Course in SceneGraph available on GitHub

that's just to load the data... applying it to a gridscreen is up to you. It took me a while to get my head around how to structure the roContentNodes properly for the different lists, they each require a specific hierarchy of nodes to work right.
EDIT I take that back, that example is supposed to work with a RowList. make sure `mediaitem.xml` is in your `components` directory. I don't have time to debug it right now...
0 Kudos
mkdir1995
Visitor

Re: Crash Course in SceneGraph available on GitHub

"tim_beynart" wrote:
that's just to load the data... applying it to a gridscreen is up to you. It took me a while to get my head around how to structure the roContentNodes properly for the different lists, they each require a specific hierarchy of nodes to work right.
EDIT I take that back, that example is supposed to work with a RowList. make sure `mediaitem.xml` is in your `components` directory. I don't have time to debug it right now...

I copied over your examples to my own project and I actually did not see any RowList appear, just a blank screen, but no errors either (which I guess is good lol). I'm using your crash course/JSON feed example with the Roku Sample Tutorial so hopefully I'll get it working soon. The SceneGraph stuff is a whole other level for me... thanks for the help 🙂
0 Kudos
tim_beynart
Channel Surfer

Re: Crash Course in SceneGraph available on GitHub

try this and see if it fixes it...
on this line https://gist.github.com/timbeynart-nbcuni/c73989ff347b101ef4176b8c104f82af#file-parse_json-brs-L9
change "GridScreen" to "RowList" to match the id in the XML file.
0 Kudos
mkdir1995
Visitor

Re: Crash Course in SceneGraph available on GitHub

"tim_beynart" wrote:
try this and see if it fixes it...
on this line https://gist.github.com/timbeynart-nbcuni/c73989ff347b101ef4176b8c104f82af#file-parse_json-brs-L9
change "GridScreen" to "RowList" to match the id in the XML file.

I've actually always gotten an error on that line, and had it commented out - 
Current Function:
001:  sub loadContent()
002:    shortFormRow = GetShortForm()
003:    list = [
004:        {
005:            TITLE : "Short Form"
006:            ContentList : shortFormRow
007:        }
008:    ]
009:*   m.contentselection = m.top.findNode("RowList")
010:    m.contentselection.content = ParseContent(list)
011:  end sub
Interface not a member of BrightScript Component (runtime error &hf3) in pkg:/source/parse_json.brs(9)
009:   m.contentselection = m.top.findNode("RowList")

 
I've got my code set up just like yours, but I see this when I try running it. Not sure why. I had it commented out last week but still haven't fully debugged.
0 Kudos
tim_beynart
Channel Surfer

Re: Crash Course in SceneGraph available on GitHub

i have to admit i just copied these files from a more complete project... never fully debugged 'em
0 Kudos
mkdir1995
Visitor

Re: Crash Course in SceneGraph available on GitHub

"tim_beynart" wrote:
i have to admit i just copied these files from a more complete project... never fully debugged 'em

I just successfully used your JSON with the Simple Grid with Details and Video example. So that's one step closer, at least! thank you!!! 
0 Kudos
360tv
Streaming Star

Re: Crash Course in SceneGraph available on GitHub

Hey, I just wanted to say thanks for this crash course. I've been putting off getting caught up on this new Scene Graph thing since I've been away from Roku development for a long while. I couldn't wrap my brain around the concepts until I followed this. There's a few mistakes, I can't remember what they were, but I was able to figure it out and get it done. I learned a ton in the few hours it took me to do this. Thanks again!

P.S. Be aware, I skipped lesson 6 on account of the readme.md links Lesson 6 and Lesson 7 both to Lesson 7, skipping 6, explaining why my video player didn't get set up. 

P.P.S. If anyone can point me in the right direction for figuring out an Error Code -4: "No Streams were provided for playback" error for a hls stream that I know works everywhere else, including my old Roku channel? I plugged in the url for the stream in the first entry of the drama.json;

    "items": [
        {
            "id": "D123",
            "title": "360 Music Television",
            "description": "Live Video Feed",
            "thumbnail": "http://xxx.xxx.xxx.xxx/roku_lessons/images/thumbnail-drama1.jpg",
            "url":"http://xxx.xxx.xxx.xxx/live/360/index.m3u8",
            "streamformat":"hls"
        }
]
0 Kudos
newchannel
Roku Guru

Re: Crash Course in SceneGraph available on GitHub

Thank you for all of your work and time to provide the tutorial. I have several channels to migrate over to scenegraph and your tutorial will be very helpful.
http://www.victoryNOWfilmsandtv.com
0 Kudos