Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
hugetv
Level 7

help to roGridScreen fast loading content

I can help to load the covers as fast as 1,000 movies surpasses the content is put slow loading



Sub showMoviesScreen()
dlg = CreateObject("roOneLineDialog")
dlg.setTitle("Loading Collection")
dlg.showBusyAnimation()
dlg.show()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetGridStyle("flat-portrait")
screen.SetDescriptionVisible(true)
screen.SetBreadcrumbText("Movies", "Session")

categoryList = getCategoryListMovies()
categoryCount = categoryList.count()

seriesList = CreateObject("roList")

screen.SetupLists(categoryCount)
screen.show()
screen.setListNames(categoryList)

for i = 0 to categoryCount-1
tmpMoviesList = getMoviesByCategory(categoryList[i])
screen.SetContentList(i,tmpMoviesList)
seriesList.AddTail(tmpMoviesList)
screen.show()
end for

screen.show()

dlg.close()
while true
msg = wait(0, port)

if msg <> invalid and type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
exit while
else if msg.isListItemFocused()
print "Focused msg: ";msg.GetMessage();"row: ";msg.GetIndex();
print " col: ";msg.GetData()
else if msg.isListItemSelected() then
print "Selected msg: ";msg.GetMessage();"row: ";msg.GetIndex();
'selection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]

list = seriesList.GetEntry(msg.GetIndex())
if list <> invalid then
selection = list[msg.GetData()]
end if

if selection.Title = "Search"
searchMovies()
else if selection.Title = "Favorites"
FavoritesMovies()
else
showSpringboardScreenMovies(selection)
end if

end if
end if
end while

End Sub

Function getCategoryListMovies() as object
jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL(UrlServidor()+"/category.php?t=movies")
json = ParseJson(jsonAsString.GetToString())
return json
End Function


Function getMoviesByCategory(category)
jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL(UrlServidor()+"/movies.php?cat="+category)
json = ParseJson(jsonAsString.GetToString())
return json.Videos

End Function

Our system http://www.rokumanager.com
0 Kudos
4 Replies
hugetv
Level 7

Re: help to roGridScreen fast loading content

please help to how to avoid not charge slow if not open much faster
Our system http://www.rokumanager.com
0 Kudos
TheEndless
Level 7

Re: help to roGridScreen fast loading content

You'll likely need to address it on the server end. If you need to load that many objects without slowing down the UI, then you'll need to implement some sort of paging.
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
hugetv
Level 7

Re: help to roGridScreen fast loading content

which would be the solution you indicate I appreciate your help
Our system http://www.rokumanager.com
0 Kudos
hugetv
Level 7

Re: help to roGridScreen fast loading content

someone could help me please because the server goes down with so many requests to make a solution and resolve carrying non once the content
Our system http://www.rokumanager.com
0 Kudos