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: 
jbrave
Channel Surfer

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

if you go into Staff picks on Vimeo and go all the way to the right end of staff picks, you get a "Next >>" link that will take you to the next set of more staff picks.

In my case the next set of 10 media items will be retrieved by incrementing an offset variable.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
36 REPLIES 36
TheEndless
Channel Surfer

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

Just add a faux "Next >>" content item to your content list, and trigger a new lookup when it's selected.
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
RokuChris
Roku Employee
Roku Employee

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

TheEndless is right. The paging feature is very handy for displaying large data sets or data from an API that returns results in pages. Paging is something I think a lot of channels could benefit from, so here's a more detailed explanation of how to do it.

To show the "next" item on your roPosterScreen, you need to add an extra content-meta-data item onto the end of your content list. That item might look something like this:
{
shortDescriptionLine1: "Next Page"
sdPosterURL: "pkg:/images/next_sd.png"
hdPosterURL: "pkg:/images/next_hd.png"
action: "next"
}


You might also want to have a "previous" item on the front end of your content list to let users go the other direction:
{
shortDescriptionLine1: "Previous Page"
sdPosterURL: "pkg:/images/previous_sd.png"
hdPosterURL: "pkg:/images/previous_hd.png"
action: "previous"
}


And then you would need to add some logic to your event loop to handle the case when a user selects your navigation items:
while true
msg = wait(0, screen.GetMessagePort())
if msg <> invalid
if msg.isListItemSelected()
item = content[msg.GetIndex()]
if item.action = "next"
' load and display the next page of data
else if item.action = "previous"
' load and display the previous page of data
else
' handle the selection of other poster items
end if
end if
end if
end while
0 Kudos
EngoTom
Visitor

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

My app too could benefit from this navigation pattern.

This handles list view but how should this be handled when the user is in detail view?

Going to have to conditionally handle all the button visible properties and build a hybrid item for Next & Prev I think???

When performing a page query should we just load the 2nd page on the stack? I don't think so. This could get tricky real quick.
0 Kudos
RokuChris
Roku Employee
Roku Employee

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

"EngoTom" wrote:
My app too could benefit from this navigation pattern.

This handles list view but how should this be handled when the user is in detail view?

Going to have to conditionally handle all the button visible properties and build a hybrid item for Next & Prev I think???

When performing a page query should we just load the 2nd page on the stack? I don't think so. This could get tricky real quick.


I wouldn't display springboards for the next/previous items at all. When navigating left or right from springboard to springboard, just skip over them and either cycle around to the other end of the current result set or dynamically load up the appropriate new set.
0 Kudos
jbrave
Channel Surfer

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

One more question on this: if you don't want to display the "previous" link when you are on the first set of retrieved items, but on all subsequent sets of items? In the app I'm working on there are probably actually millions of items, so cycling to the end doesn't make sense and the API doesn't give me a count.

-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

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

"jbrave" wrote:
One more question on this: if you don't want to display the "previous" link when you are on the first set of retrieved items, but on all subsequent sets of items? In the app I'm working on there are probably actually millions of items, so cycling to the end doesn't make sense and the API doesn't give me a count.

-Joel

I'm not sure I understand the question. If you're controlling the paging, then you should know what page you're on. If you're on the first, just don't add the "Previous" content item...?
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
jbrave
Channel Surfer

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

Yeah, that makes sense, base it on the offset from the top.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
dynamitemedia
Binge Watcher

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

I been trying this with the video player example and its giving me all sort of issues

I added this

conn = InitShowFeedConnection(category.kids[item])
showList = conn.LoadShowFeed(conn)

showList.Push( { action: "next", ShortDescriptionLine1: "Next", HDPosterUrl: "pkg:/images/forward.png", SDPosterUrl: "pkg:/images/forward.png" })


so far so good....

So i try to ad a "if " statement in the "msg.ListItemSelected" and all i am getting are errors


else if msg.isListItemSelected() then

if showList.action ="next"
print " get next 10 videos"

else if showList.action ="previous"
print " Go Back 10 videos"

else
m.curShow = msg.GetIndex()
m.curShow = displayShowDetailScreen(category, m.curShow)
screen.SetFocusedListItem(m.curShow)
end if
end if


what am I doing wrong here? i have tried several combos in the "showList.action" area but i cant figure out how to get the action.
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?

action isn't a attribute on the showList array, it's an attribute on the item you added to the array. Try this instead:
if showList[msg.GetIndex()].action = "next" then...
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