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: 
jbrave
Channel Surfer

Re: dealing with large numbers of videos

You know, it's very cool that you wrote librokudev, but it really needs documentation. I would be willing to pay for good documentation of Librokudev. Maybe $35? Something like that, maybe more if necessary.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
kbenson
Visitor

Re: dealing with large numbers of videos

"jbrave" wrote:
You know, it's very cool that you wrote librokudev, but it really needs documentation. I would be willing to pay for good documentation of Librokudev. Maybe $35? Something like that, maybe more if necessary.


Sheesh, I would feel bad taking money to do the work on that. But the request itself may be enough to spur me into action (since I really would like to know people are using it, and the docs are probably a big hurdle). Maybe I can get some work done on that soon.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
jbrave
Channel Surfer

Re: dealing with large numbers of videos

"destruk" wrote:
Having it load 2000 videos, images, and data for a single selection screen sounds like too much to me.


Actually, as it turns out, the delay was on the API side not on the Roku side, using xml text files everything loads much faster. The parsing is still on the order of 900 milleseconds, but that isn't too bad. Maybe there's a faster way, as KBenson suggested, one second to parse is a long time, if so, please let me know. Here's my code:

function parsexml(xmlxfer as string) as object
timer=createobject("rotimespan")
timer.mark()
xml=createobject("RoXMLElement")
posterlist=createobject("roArray",1,true)
if xml.parse(xmlxfer) then

if xml.channel.item.count() <1 then

?"no vids in this channel"
return [{Title:"",ShortDescriptionLine1:"No Content",SDPosterURL:"pkg:/images/blank.png",HDPosterURL:"pkg:/images/blank.png",url:"",action:""}]
end if



for each vid in xml.channel.item
group=vid.GetNamedElements("media:group")
content=group.getnamedElements("media:content")
tempitem=(GetVideoDataFromXML(vid))
posterlist.push(tempitem)
next
end if
?"XML Parse Time"; timer.totalseconds()
return posterlist

end function

function GetVideoDataFromXML(video) as object

vidposters=createobject("roarray",1,true)
posterobj=createobject("roassociativearray")

media=createobject("roassociativearray")
mediaArray=createobject("roArray",1,true)

group=video.GetNamedElements("media:group")
content=group.getnamedElements("media:content")

posterobj.Title=video.GetNamedElements("title").gettext()
posterobj.description=video.GetNamedElements("description").gettext()
posterobj.pubdate=video.GetNamedElements("pubdate").GetText()
posterobj.video=content 'mediaArray
posterobj.SDPosterURL=video.GetNamedElements("media:thumbnail")@url
posterobj.HDPosterURL=posterobj.SDPosterURL
posterobj.Action="details"
posterobj.ContentType="episode"
posterobj.ShortDescriptionLine1=posterobj.Title
posterobj.ShortDescriptionLine2=posterobj.Description
'if posterobj.description=""
' posterobj.description=posterobj.ShortDescriptionLine1
'end if
return posterobj
end function
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: dealing with large numbers of videos

"jbrave" wrote:
Actually, as it turns out, the delay was on the API side not on the Roku side, using xml text files everything loads much faster. The parsing is still on the order of 900 milleseconds, but that isn't too bad. Maybe there's a faster way, as KBenson suggested, one second to parse is a long time, if so, please let me know. Here's my code:

Your code looks fine to me. If the delay is on the API side, then using AsyncGetToString()s is definitely a good option for increasing responsiveness, so my suggestion above may be worth looking into. A delay or one second is bearable, so I wouldn't be concerned about the parsing time. If you're loading all 20+ rows before responding to events, however, I'd recommend doing it on a row-by-row basis, and interrupt as necessary based on user interaction.

I have a channel that's coming out soon that uses this method... I store the details for loading the row (ex. url, content type, etc.) on the row object, then have a low timeout on my Wait loop.. on "invalid" messages, I start loading rows, and interrupt on valid messages. Because I launch new screens in that same Wait loop, it blocks until the user returns to the screen, and continues loading rows from there. (I have no idea if that actually makes sense typed out :P)
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
rjdjohnston
Binge Watcher

Re: dealing with large numbers of videos

"TheEndless" wrote:
"jbrave" wrote:

I have a channel that's coming out soon that uses this method... I store the details for loading the row (ex. url, content type, etc.) on the row object, then have a low timeout on my Wait loop.. on "invalid" messages, I start loading rows, and interrupt on valid messages. Because I launch new screens in that same Wait loop, it blocks until the user returns to the screen, and continues loading rows from there. (I have no idea if that actually makes sense typed out :P)


Do you have an example you'd be willing to share?

Having this very issue. When the user comes back it's reloading the lists which takes 20 seconds total. :?

Thanks
My channels: Amiri King, Donnie Baker, Worldview Weekend - Twitter @rjdjohnston
0 Kudos
RokuJoel
Binge Watcher

Re: dealing with large numbers of videos

I'm sorry I don't. That was a long time ago.

- Joel
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.