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: 
dynamitemedia
Binge Watcher

Re: how to do that Vimeo style "next >>" link?

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:

.Title

and 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
0 Kudos
TheEndless
Channel Surfer

Re: how to do that Vimeo style "next >>" link?

I think it's going to be a lot easier, if you just leave everything else the way it is, and just modify what "getShowsForCategoryItem" returns. As long as it returns your search items in the same format as it's expecting, it should just work. Don't get caught up in renaming category to search and vice versa, because I think that's what's mainly tripping you up. So, I would recommend starting afresh with the SimplePoster.brs, and just change the "getShowsForCategoryItem" function.
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
dynamitemedia
Binge Watcher

Re: how to do that Vimeo style "next >>" link?

endless i almost got this but this "category" is using a "roAssociativeArray"

I tried printing all sorts of ways to get the category's info so i can hard code it in my show feed

category kids <ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>


and no matter what i do as far as printing goes i cant figure out all that makes this variable so i can recreate it and hard code it here:

conn = InitShowFeedConnection(category.kids[item])


if xml looks like this:

<categories>

<category title="world war two" description="" sd_img="http://xxxxxx.com/roku/images/wwII.jpg" hd_img="http://xxxxxx.com/roku/images/wwII.jpg">

<categoryLeaf title="search" description="" feed="http://xxxxxx.com/roku/feeds/search.php"/>
</category>


and i need to get to the "feed" what could i use to replace this ")"

i tried using InitShowFeedConnection(movies) but that didnt work either
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: how to do that Vimeo style "next >>" link?

"dynamitemedia" wrote:
endless i almost got this but this "category" is using a "roAssociativeArray"

I tried printing all sorts of ways to get the category's info so i can hard code it in my show feed

category kids <ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>
<ROT:roAssociativeArray>


and no matter what i do as far as printing goes i cant figure out all that makes this variable


There is a PrintAA() utility function in the example code that I find very useful. It takes a roAssociativeArray as an argument and prints its contents to the console.
0 Kudos
dynamitemedia
Binge Watcher

Re: how to do that Vimeo style "next >>" link?

Thanks Chris,

But I added that all i get is a error saying

Wrong number of function parameters.

167: PrintAA()


i am guessing there is more than just typing that in now.... and if so, what is the complete and correct way of doing it?

you said example code, which example though?
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
renojim
Community Streaming Expert

Re: how to do that Vimeo style "next >>" link?

You missed where Chris said, "It takes a roAssociativeArray as an argument". So you need PrintAA(category).

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
dynamitemedia
Binge Watcher

Re: how to do that Vimeo style "next >>" link?

thanks RenoJim....

the problem is that this can still be confusing and i take what is given to me literally at times, I am still not getting this to work even after ready that array

I am just trying to reproduce it so i can do a search in the video player example, i can get it right to the point of showing the feed but not able to view it once clicked. basically i cant click the the video in the poster and send it to the springboard that the video player already uses.

I think my only chance is to bloat the code more and just create another AppDetailscreen. i was trying to avoid that by changing some code around and using existing code, but i have found that these examples do not play well with each other!at least with what i can do with brightscript.

thanks for all your help guys
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
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.