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

How to get server side xml list of shows into grid category?

Working on a sample to try a grid layout.

I have the following code snippet in an XML file that is in the channel package to display a grid:


<row title="Videos">
<item type="video"
title="xxxxx"
sdposterurl="http://xxxxxxxxxxxxxxxxxx.png"
hdposterurl="http://xxxxxxxxxxxxxxxxxx.png"
length="846"
url="http://xxxxxxxxxxxxxxx.mp4"
contentid="xxxxxxx"
streamformat="mp4">





I have xml on my server so I can change the content without affecting the package.

How do I connect the grid to show each of the films listed in the xml file that I have on my server? This list of movies needs to show up in one of the grid category levels. Each level in the grid will have its own xml file on my server.

In the above code snippet, I know I wont be using the url of the video since I need to show the whole list of videos that are in the xml on server. Is it a url xfer and if so what's the proper way to code it?

Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
5 REPLIES 5
destruk
Binge Watcher

Re: How to get server side xml list of shows into grid categ

You'd either need a single master xml file with all the content for all the categories on the screen that you want to display, or you could download just what you need to display on the current screen and use paging requests to grab more data if more exists when the user navigates through your content. I haven't used NetFlix in awhile so I don't remember how they do it - but I'd guess they download the first 20 items for each of their categories and then request more if you scroll fast enough.
0 Kudos
newchannel
Roku Guru

Re: How to get server side xml list of shows into grid categ

Hi destruck,

I believe I did learn today how to make the one xml with all of the list of videos ifor each of the rows for the grid. Don't know where in the channel coding to reference it so I can place the xml on my server and not in the package. Right now the example I have, it has the xml inside the package.

I'm guessing that somewhere in the source files I would maybe do a xfer=createobject("rourltransfer") type of thing to get it to reference the one xml on the server so I can make changes to the videos.

I see a url xfer in my code for banner ads

 xfer=createobject("rourltransfer")
xfer.seturl("http://www.xxxxxxx/php/bannerads.php")
tempa=xfer.gettostring().tokenize(",")



Is it a url xfer to reference the server side xml? And if yes, then how is the url xfer actually typed out? I'm sure I only have one part of it correct, not sure if the tokenize part is only for the banner ads. Not sure how to properly code the xfer.

Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
newchannel
Roku Guru

Re: How to get server side xml list of shows into grid categ

I believe I did read someplace today that it is 20.
http://www.victoryNOWfilmsandtv.com
0 Kudos
destruk
Binge Watcher

Re: How to get server side xml list of shows into grid categ

You could either download the file to tmp like you have there, or you could read it in as a string and parse the string with http.GetToStringWithRetry() I think most people rework the categories.brs file from one of the sample apps to get this functionality into their grid screen.
0 Kudos
newchannel
Roku Guru

Re: How to get server side xml list of shows into grid categ

Just wanted to post that I have it reading my xml on the server. One part to figure out is how to have the channel open only on the grid screen and not a category screen that has folders with the grid.
http://www.victoryNOWfilmsandtv.com
0 Kudos