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: 
hugetv
Visitor

help with code that does not work

ok I have the problem that you select the episode makes it perfect strike to go back again to the top of the list

EpisodeScreen.brs

sub ShowEpisodeScreen(show, leftBread, rightBread)

Dbg("episode url: ", show.url)
Dbg("episode rss: ", show.content)

mrss = NWM_MRSS(show.url,show.content)
content = mrss.GetEpisodes()
if content.Count() = 0
' TODO: show an error dialog
return
end if

if false
screen = CreateObject("roPosterScreen")
screen.SetMessagePort(CreateObject("roMessagePort"))
screen.SetListStyle("flat-episodic-16x9")
'screen.SetListStyle("flat-category")

selectedEpisode = 0
screen.SetContentList(content)
end if
if true
screen = CreateObject("roGridScreen")
screen.SetGridStyle("four-column-flat-landscape")
'screen.SetDisplayMode("scale-to-fit")
screen.SetDisplayMode("photo-fit")
screen.SetMessagePort(CreateObject("roMessagePort"))
doCerts(screen)

numrows = content.count() + 1
selectedEpisode = 0
screen.SetupLists(numrows) ' count of rows
labels = []

row = 0
col = 1
gridarr = []
for each i in content
gridarr.push(i)
if col = content.count()
labels.push(leftBread) ' ("row " + str(row))
screen.setContentList(row,gridarr)
gridarr = []
row = row + 1
col = 0
end if
col = col + 1
next
if row < numrows
labels.push(leftBread) ' ("row " + str(row))
screen.setContentList(row,gridarr)
end if
screen.setListNames(labels)

end if

screen.SetBreadcrumbText(leftBread, rightBread)
screen.Show()

while true

msg = wait(0, screen.GetMessagePort())

if msg <> invalid
if msg.isScreenClosed()
exit while
else if msg.isListItemFocused()
selectedEpisode = msg.GetIndex()
selectedEpisodeGrid = msg.getData()

else if msg.isListItemSelected()
if Type(screen) = "roGridScreen"
selectedEpisode = ShowSpringboardScreen(content, selectedEpisodeGrid, leftBread, "")
screen.SetFocusedListItem(selectedEpisode,selectedEpisodeGrid)
else
selectedEpisode = ShowSpringboardScreen(content, selectedEpisode, leftBread, "")
screen.SetFocusedListItem(selectedEpisode)
'screen.Show()
end if
else if msg.isRemoteKeyPressed()
if msg.GetIndex() = 13
if content[selectedEpisode].streamFormat = "mp3"
ShowAudioScreen(content, selectedEpisode, leftBread, "")
else
ShowVideoScreen(content[selectedEpisode])
end if
end if
end if
end if
end while
end sub



as I can do that again you have selected episode
Our system http://www.rokumanager.com
0 Kudos
6 REPLIES 6
hugetv
Visitor

Re: help with code that does not work

please help
Our system http://www.rokumanager.com
0 Kudos
RokuJoel
Binge Watcher

Re: help with code that does not work

I don't really understand your description of the problem, but it sounds like maybe you might want to add a return statement after msg.IsScreenClosed() instead of an exit while. If you want to pass data back to the calling function then make it a function instead of a sub and return a value.

- Joel
0 Kudos
hugetv
Visitor

Re: help with code that does not work

my problem is I go to the selection of video but do not fall back behind which selecione
Our system http://www.rokumanager.com
0 Kudos
hugetv
Visitor

Re: help with code that does not work

help this index
Our system http://www.rokumanager.com
0 Kudos
hugetv
Visitor

Re: help with code that does not work

this is what I have in problem

When you select a content
Selected msg: row: 0 col: 12

and when I return to roGridScreen
Focused msg: row: 0 col: 2

I want you to fall back on the same site

Focused msg: row: 0 col: 12
Our system http://www.rokumanager.com
0 Kudos
hugetv
Visitor

Re: help with code that does not work

I need help to do that by going back after selecting the number falls in the same select
Our system http://www.rokumanager.com
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.