"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-L15, you 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
"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...
"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.
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")
"tim_beynart" wrote:
i have to admit i just copied these files from a more complete project... never fully debugged 'em
"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"
}
]
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 19th and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
We're sorry for this disruption — we’re excited to share what’s next!
For support, visit support.roku.com.