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: 
oliver9000
Visitor

1000+ videos best practice

i'm a newbie brightscript dev with a question about displaying a high volume of videos. The client has 1000+ videos and maybe 10 categories. They want to use the grid screen to display them all by category. In theory we would have one giant XML file to parse with 100 or so episodes in each category. Are there performance issues with doing this? Should we be using a poster screen to cycle through the categories and then launch a sub screen? The client wants a flat navigation with as few clicks between a poster and a video watch. thanks!
0 Kudos
7 REPLIES 7
Gilgamesh
Visitor

Re: 1000+ videos best practice

"oliver9000" wrote:
i'm a newbie brightscript dev with a question about displaying a high volume of videos. The client has 1000+ videos and maybe 10 categories. They want to use the grid screen to display them all by category. In theory we would have one giant XML file to parse with 100 or so episodes in each category. Are there performance issues with doing this? Should we be using a poster screen to cycle through the categories and then launch a sub screen? The client wants a flat navigation with as few clicks between a poster and a video watch. thanks!


You should ask this in the developer forum as you will get more and better responses however:

I am using Roksbox and I have over 1800 video files in 30 or so genera. If I use an XML file I get extremely slow operation and even occasional lockups however in the directory mode, which separates the files by directories, I can use either the grid or the poster screen with pretty good performance but the grid screen provides the best performance. I have no idea if your app could be suited to the setup like I am using but I do know that the Roku is not really good at crunching numbers as its processor is, even at the fastest, quite slow and processing anything like an XML file is really number crunching.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: 1000+ videos best practice

Parsing very large XML documents can have performance implications, especially on older boxes. But that shouldn't stop you from using the grid. You can break things into multiple API calls each with a smaller response. One call to get the list of rows, then individual calls to get the items for each row.
0 Kudos
destruk
Binge Watcher

Re: 1000+ videos best practice

"oliver9000" wrote:
The client wants a flat navigation with as few clicks between a poster and a video watch. thanks!


I think the fewest clicks possible is one - select the poster and have it automatically start playing the selected video. You could remove that single click requirement by enabling a timer and every time the row and/or column selection changes, reset the timer. Then you could have it autoplay the video if the same poster has been selected for a desired X number of seconds without requiring a click to select the video to get it to play.
0 Kudos
oliver9000
Visitor

Re: 1000+ videos best practice

thanks for your responses! @RokuChris, i think we're going to try your approach and have one initial xml feed with the categories populate the rows of a gridscreen. Then have each category kick off an async request for the xml feed containing the items of that row.
0 Kudos
joetesta
Roku Guru

Re: 1000+ videos best practice

"oliver9000" wrote:
thanks for your responses! @RokuChris, i think we're going to try your approach and have one initial xml feed with the categories populate the rows of a gridscreen. Then have each category kick off an async request for the xml feed containing the items of that row.


Hi oliver -
I'm working on a large grid and have it loading 5 rows at a time as the user scrolls down, which works, but it's buggy because the user can go down faster than the rows can load. I'm thinking about throwing up a "Retrieving" facade to make them wait while new rows load. But I'm looking around for a better option and wondering how this worked out for you - how do you continue to load rows while simultaneously listening for events? Do you do something to prevent them from scrolling down too fast or if they do then the rows eventually load so it's no big deal?

Thank you,
Joe
aspiring
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: 1000+ videos best practice

"joetesta" wrote:
"oliver9000" wrote:
thanks for your responses! @RokuChris, i think we're going to try your approach and have one initial xml feed with the categories populate the rows of a gridscreen. Then have each category kick off an async request for the xml feed containing the items of that row.


Hi oliver -
I'm working on a large grid and have it loading 5 rows at a time as the user scrolls down, which works, but it's buggy because the user can go down faster than the rows can load. I'm thinking about throwing up a "Retrieving" facade to make them wait while new rows load. But I'm looking around for a better option and wondering how this worked out for you - how do you continue to load rows while simultaneously listening for events? Do you do something to prevent them from scrolling down too fast or if they do then the rows eventually load so it's no big deal?

Thank you,
Joe


Many channels successfully use a combination of strategies to load grid content in a timely manner.

Instead of loading 5 rows at a time, set a non-zero timeout on your Wait() and load one row each time through the event loop when the Wait() times out and returns invalid. You could also use GetMessage() combined with a roTimespan to accomplish something similar.

At the same time that you're populating single rows without any user action, you can also listen for isListItemFocused to detect when the user scrolls to a given row and immediately populate that row (if it isn't already) and maybe the rows above and below it to fill in the screen depending on the grid style.

If you wanted to take it a step further, you could make the requests asynchronously. That way you wouldn't have to wait for the response to come back before you could handle the next event.
0 Kudos
TheEndless
Channel Surfer

Re: 1000+ videos best practice

I also like to pre-populate rows with a "Loading" icon, so as the user scrolls to a row that isn't loaded, yet, they at least know something is happening instead of just getting an empty row.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos