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

problem displaying content

problem displaying content

' ********************************************************************
' ** flix4free
' ** Copyright (c) 2104 Hemen Kapadia
' ********************************************************************
' Displays the TV series selection screen grid
' Level 2 Screen

Sub showTVSeriesScreen()
screen = CreateObject("roGridScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetGridStyle("flat-portrait")
screen.SetDescriptionVisible(true)


categoryList = getCategoryList()
categoryCount = categoryList.count()

seriesList = CreateObject("roList")

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


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

screen.show()

while true
msg = wait(0, port)
if msg <> invalid and type(msg) = "roGridScreenEvent" then
if msg.isScreenClosed() then
exit while
else if msg.isListItemSelected() then
selection = seriesList.GetEntry(msg.GetIndex())[msg.GetData()]
showSpringboardScreen(selection)
end if
end if
end while

End Sub



Function getCategoryList() as object
contentList = [ "Action","Comedy" ]
return contentList
End Function

Function getSeriesByCategory(category as string) as Object
print category
jsonAsString = CreateObject("roUrlTransfer")
jsonAsString.SetURL("http://62.108.40.131/movie.json")
json = ParseJson(jsonAsString.GetToString())

return json.category


End Function
Our system http://www.rokumanager.com
0 Kudos
1 Reply
hugetv
Level 7

Re: problem displaying content

as to solve the problem
Our system http://www.rokumanager.com
0 Kudos