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

Slow posterScreen navigation

I have a roPosterScreen (arced-landscape) with 30 posters.

I'm storing the posters on a server with links to them in an xml file. I read in the xml and set the SDPosterURL and HDPosterURL to the respective URLs. The images download and display, but when I'm navigating, it takes about 1-2 seconds to move from 1 selection to the next.

I thought maybe it was taking so long because it was downloading the image each time I selected a new one, so I packaged the images into the channel and referenced them local, but it's still very slow.

Here is my screen code

Function showTeamPosterScreen(screen As Object) As Integer

if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1

m.curShow = 0

teams = getTeams()
screen.SetContentList(teams)
screen.Show()

while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roPosterScreenEvent" then
print "showTeamPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
if msg.isListFocused() then
m.curShow = 0
screen.SetFocusedListItem(m.curShow)
print "msg.GetIndex = "; msg.GetIndex()
if msg.GetIndex() = 0 then
screen.SetContentList(getShowsForLive())
else if msg.GetIndex() = 1 then
screen.SetContentList(getVodCategories())
end if
print "list focused | current category = "; m.curCategory
else if msg.isListItemSelected() then
m.curShow = msg.GetIndex()
print "list item selected | current show = "; m.curShow
if teams[m.curShow].SubCat = 3 then
print "preShowTeamGamesScreen"
subScreen = preShowTeamGamesScreen("On-Demand by Team", teams[m.curShow].Title)
if subScreen=invalid then
print "unexpected error in preShowTeamGamesScreen"
return -1
end if
showTeamGamesScreen(subScreen, teams[m.curShow].TeamId)
end if
screen.SetFocusedListItem(m.curShow)
print "list item updated | new show = "; m.curShow
else if msg.isScreenClosed() then
return -1
end if
end If
end while
End Function


brockoli
0 Kudos
12 REPLIES 12
brockoli
Visitor

Re: Slow posterScreen navigation

I should point out that if I just don't show images at all, navigation is fast. My image sizes are ~20kb each

brockoli
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Slow posterScreen navigation

This can happen when the images are dimensionally larger than the poster screen needs and are being scaled down to be displayed.
0 Kudos
renojim
Community Streaming Expert

Re: Slow posterScreen navigation

It would be nice if the box cached the scaled images.

-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
destruk
Streaming Star

Re: Slow posterScreen navigation

You can have the server resize the images before sending them to the roku, or have the server resize them and upload the changed sizes to the content server with their names before generating the xml.
That's what one of our channels does and it works great.

http://www.white-hat-web-design.co.uk/b ... -with-php/
0 Kudos
renojim
Community Streaming Expert

Re: Slow posterScreen navigation

The problem is when you use images from a server you have no control over. The Pentagon Channel I did is an example. There's no reason for the box to scale the posters every time you move through the screen. Do it once, cache the images and be done with it.

-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
destruk
Streaming Star

Re: Slow posterScreen navigation

I understand what you're saying, however, with images at 30-40KB each you can just as easily copy/upload them to a server you do have control over. Just with some bugs existing for multiple years on Roku, I wouldn't count on having any fixes appear for this for a long time.
0 Kudos
agmark
Visitor

Re: Slow posterScreen navigation

"renojim" wrote:
The problem is when you use images from a server you have no control over. The Pentagon Channel I did is an example. There's no reason for the box to scale the posters every time you move through the screen. Do it once, cache the images and be done with it.

-JT


I'm having this same posterscreen delay on my channels that grab the posterurl images from rss files that I have no control of. What would be the correct method of caching the images? I assume you're saving them to tmp:/ but I'm unclear of the actual mechanics of doing that.

I'm using the generic parsing code like this this:
				tmp = group.GetNamedElements("media:thumbnail")								
newItem.sdPosterURL = ValidStr(tmp[0]@url)
newItem.hdPosterURL = ValidStr(tmp[0]@url)

With a couple dozen or more of images, my posterscreen is painfully slow. Can anyone help speed things up?
TIA
Mark
0 Kudos
bandal
Visitor

Re: Slow posterScreen navigation

Strange, I have 40+ images and mine is very fast. Using videoplayer. Could be that I spread them over a few servers.
0 Kudos
renojim
Community Streaming Expert

Re: Slow posterScreen navigation

"agmark" wrote:
With a couple dozen or more of images, my posterscreen is painfully slow. Can anyone help speed things up?
TIA
Mark

It's not the fetching of the images that's the problem; it's the box scaling the images that's so slow. What size are the images you're using for your posters? If their size is significantly different than the artwork sizes given in the Component Reference then the poster screen becomes painfully slow. Unless the firmware is changed to cache the scaled image rather than scaling it every time something on the screen changes, there isn't much you can do unless you can send the image somewhere to be scaled and then you use that scaled image.

-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
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.