Roku Developer Program

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

roPosterScreen Items adding

Hi Presenly Iam adding roPosterScreen Items using a array...
But I want this items to be added from a XML file and also when a menu item is selected we need get the corresponding sub menu item from XML....



screen = CreateObject("roPosterScreen")
categoryList = getCategoryList() //Now this should be from a xml file....
screen.SetListNames(categoryList)
screen.SetIconArray(getShowsForCategoryItem(categoryList[0]))

//below two functions values should be from xml file....
Function getCategoryList() As Object

categoryList = CreateObject("roArray", 10, true)

categoryList = [ "My Channel", "Add Channel","Remove Channel" ]
return categoryList

End Function

Function getShowsForCategoryItem(category As Object) As Object

print "getting shows for category "; category

showList = [
{
ShortDescriptionLine1:"IPL",
ShortDescriptionLine2:"Indian Premier League",
HDPosterUrl:"pkg:/images/ipl.jpg",
SDPosterUrl:"pkg:/images/ipl.jpg"
}
{
ShortDescriptionLine1:"Pop Channel",
ShortDescriptionLine2:"Free Live Video Streaming,Online Broadcasts",
HDPosterUrl:"pkg:/images/popcorn.png",
SDPosterUrl:"pkg:/images/popcorn.png"
}
{
ShortDescriptionLine1:"Roku",
ShortDescriptionLine2:"Roku Sports Channels",
HDPosterUrl:"pkg:/images/roku.png",
SDPosterUrl:"pkg:/images/roku.png"
}
]

return showList

End Function
0 Kudos
1 Reply
Highlighted
Level 9

Re: roPosterScreen Items adding

Please look at the videoplayer example code in the sdk. It is an example of parsing an xml feeds to display a hierarchy of data and filling in the content-metadata array that would be passed to an roPosterScreen. The docs also walk through XML parsing in the BrightScript Reference Section 4.5.

--Kevin
0 Kudos