This is the code that the appPosterScreen uses from the video player example to pass the video information from the Poster screen to the spring board
'**********************************************************
'** When a poster on the home screen is selected, we call
'** this function passing an roAssociativeArray with the
'** ContentMetaData for the selected show. This data should
'** be sufficient for the springboard to display
'**********************************************************
Function displayShowDetailScreen(category as Object, showIndex as Integer) As Integer
if validateParam(category, "roAssociativeArray", "displayShowDetailScreen") = false return -1
shows = getShowsForCategoryItem(category, m.curCategory)
screen = preShowDetailScreen(category.Title, category.kids[m.curCategory].Title)
showIndex = showDetailScreen(screen, shows, showIndex)
return showIndex
End Function
'***************************************************************
I need somehow for the values here :
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
m.curShow = displayShowDetailSearchScreen(m.showSearchList, m.curShow)
screen.SetFocusedListItem(m.curShow)
to populate this below:
if validateParam(
m.showSearchList, "roAssociativeArray", "displayShowDetailSearchScreen") = false return -1
shows = getShowsForCategorySearchItem(
m.showSearchList, "
0")
screen = preShowDetailScreen("
0", "
0")
showIndex = showDetailScreen(screen, shows, showIndex)
I tried
m.showSearchList because "
category" didnt seem to work
and i tried hardcoding the other parts with "
0" because I couldnt get variables to replace these:
.Titleand once again my full code is here:
Sub SearchResultsMain()
'initialize theme attributes like titles, logos and overhang color
initTheme()
'prepare the screen for display and get ready to begin
screen=preShowPosterSearchScreen("", "")
if screen=invalid then
print "unexpected error in preShowPosterSearchScreen"
return
end if
'set to go, time to get started
showPosterSearchScreen(screen)
End Sub
'******************************************************
Function preShowPosterSearchScreen(breadA=invalid, breadB=invalid) As Object
port=CreateObject("roMessagePort")
screen = CreateObject("roPosterScreen")
screen.SetMessagePort(port)
if breadA<>invalid and breadB<>invalid then
screen.SetBreadcrumbText(breadA, breadB)
end if
screen.SetListStyle("flat-category")
return screen
End Function
'******************************************************
Function showPosterSearchScreen(screen As Object) As Integer
categorySearchList = getCategorySearchList()
screen.SetListNames(categorySearchList)
screen.SetContentList(getShowsForCategorySearchItem(categorySearchList[0]))
m.showSearchList = getShowsForCategorySearchItem(categorySearchList[0])
screen.SetContentList(m.showSearchList)
screen.Show()
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
if msg.isListFocused() then
m.curCategory = msg.GetIndex()
screen.SetFocusedListItem(m.curShow)
screen.SetContentList(getShowsForCategorySearchItem(m.showSearchList, m.curCategory))
else if msg.isListItemFocused() then
print"list item focused | current show = "; msg.GetIndex()
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
m.curShow = displayShowDetailSearchScreen(m.showSearchList, m.curShow)
screen.SetFocusedListItem(m.curShow)
else if msg.isScreenClosed() then
return -1
end if
end If
end while
End Function
'**********************************************************
'** When a poster on the home screen is selected, we call
'** this function passing an roAssociativeArray with the
'** ContentMetaData for the selected show. This data should
'** be sufficient for the springboard to display
'**********************************************************
Function displayShowDetailSearchScreen(category as Object, showIndex as Integer) As Integer
'if validateParam(m.showSearchList, "roAssociativeArray", "displayShowDetailSearchScreen") = false return -1
'shows = getShowsForCategorySearchItem(m.showSearchList, "0")
'screen = preShowDetailScreen("0", "0")
'showIndex = showDetailScreen(screen, shows, showIndex)
'return showIndex
print "current show = "
return 1
End Function
'***************************************************************
Function getCategorySearchList() As Object
categorySearchList = CreateObject("roArray", 10, true)
categorySearchList = [ "Search Results" ]
return categorySearchList
End Function
'********************************************************************
Function getShowsForCategorySearchItem(category As Object) as Object
m.UrlBase = "http://xxxxxx.com/roku"
m.UrlGetSearchInfo = m.UrlBase + "/xml/search.php"
http = NewHttp(m.UrlGetSearchInfo)
'http.AddParam("genre", "wrestling")
rsp = http.Http.GetToString()
xml = CreateObject("roXMLElement")
if not xml.Parse(rsp) then
print "Can't parse response"
ShowConnectionFailed()
return ""
end if
if xml.GetName() <> "songs"
Dbg("Bad register response: ", xml.GetName())
ShowConnectionFailed()
return ""
end if
if islist(xml.GetBody()) = false then
Dbg("No registration information available")
ShowConnectionFailed()
return ""
end if
showSearchList = []
For Each song in xml.song
'initialize variables with empty strings, just in case they're missing in the XML
title = ""
url = ""
image = ""
fmt = ""
desc = ""
author = ""
title = song.name.GetText()
url = song.url.GetText()
author = song.author.GetText()
image = song.image.GetText()
fmt = song.fmt.GetText()
desc = song.desc.GetText()
song = CreateSong(title, desc, author, fmt, url, image)
showSearchList.Push(song)
Next
return showSearchList
End Function
This actually is just a rework of the simplePoster.brs in the simple poster example. we have added the ability to use xml to populate the actual poster. and now i am trying to pass that info onto the springboard screen, which i want to use the springboard already in use if possible.
Does that help? I think if i can figure out how to get those variables into what i shown above i should be able to get that over to the already built spring Board
if you have a better idea on how to do this, please pass it on... i have spent days on this and is killing me....
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway