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

Couple of Newbie Questions

Hi,

When I display my content in a grid there's a huge gaping hole at the top of the page. I realize this goes away if you scroll down the categories, however is there a way to start with the first category at the top of the page?

Here's a screen shot.




categoryList = ["Comedy Clips",
"RIFF-erendum Interviews",
"Auditory Suppository Show",
"Skits & Sketches"]

showList = getShowsForCategoryItem(categoryList[0])
podcastList = getShowsForPodcast(categoryList[1])
assList = getShowsForASS(categoryList[2])
sketchList = getShowsForSketches(categoryList[3])

screen.setupLists(categoryList.count())
screen.SetListNames(categoryList)
screen.SetContentList(0, showList)
screen.SetContentList(1, podcastList)
screen.SetContentList(2, assList)
screen.SetContentList(3, sketchList)

screen.Show()


Also, some of my content is audio only w/o video, in that case I launch an roAudioPlayer from the roSpringboardScreen. The plus side is that the cover art / preview image and description remain on the screen when the audio plays. There are at least 3 downsides to doing this, I don't see how to say "loading please wait" when the user hits play, and some of the audio files are 90-120 minutes long, so there is a slight delay. Without notification/feedback that it's actually doing something it might cause problems. Another issue is stopping playback, it's a pain. It seems like it takes a long time (after pressing button on remote) to decide to stop and go back, so it appears to be stuck playing. One more thing, after playing roAudioPlayer and stopping it, going back to the selection grid.. it's a complete wreck. There's large black areas on the screen and the selection pane is misaligned... check out this screenshot.



Code,

    
downKey=3
selectKey=6
while true
msg = wait(0, screen.GetMessagePort())
if type(msg) = "roSpringboardScreenEvent"
if msg.isButtonPressed()
if msg.GetIndex() = 1
if showObject.format = "mp4"
showVideo(showObject)
else
audio = CreateObject("roAudioPlayer")
audio.AddContent(showObject)
audio.SetLoop(false)
audio.Play()
endif
else if msg.GetIndex() = 2
audio.Stop()
return 1
endif
else
print "Unknown event: "; msg.GetType(); " msg: "; msg.GetMessage()
endif
else
print "wrong type.... type=";msg.GetType(); " msg: "; msg.GetMessage()
endif
end while


If I use an roVideoScreen to play the audio, it shows progress/loading notification but screen goes black during audio playback. This would be cool if I could show the image during playback but I have had trouble loading an image from a URL and displaying on the screen. Does CreateObject("roBitmap"... work with an image stored at a remote Url? image does not seem to appear on screen for me.


bitmap=CreateObject("roBitmap", "http://www.example.com/image.jpg")
Screen.DrawObject(0,0, bitmap)




Thanks for any pointers/suggestions.

Waitman Gobble
San Jose California USA
0 Kudos
10 REPLIES 10
SkipFire
Visitor

Re: Couple of Newbie Questions

Just set your selected row to 1 (or 2 if the arrays are base 1, I forget off hand), that's how most of the apps work. You can do the same for horizontal spacing.
0 Kudos
waitman
Channel Surfer

Re: Couple of Newbie Questions

Hi,

OK thanks, that makes sense, I appreciate your reply.

Waitman
0 Kudos

Re: Couple of Newbie Questions

Hey,

Did you get an answer to the issue regarding loading an image remotely (bitmap=CreateObject("roBitmap", "http://www.example.com/image.jpg")?
I'm running into the same issue.

Thanks
0 Kudos
RokuJoel
Binge Watcher

Re: Couple of Newbie Questions

No it does not work that way. You first need to download the image to tmp:/ and then createobject("roBitmap","tmp:/myimage.jpg")

Make sure when you save the image, you save it with the correct file extension.

- Joel
0 Kudos
waitman
Channel Surfer

Re: Couple of Newbie Questions

thank you so much, i'll check it out.
Waitman
0 Kudos
waitman
Channel Surfer

Re: Couple of Newbie Questions

Weirdness with zoom-to-fill?

I noticed that the vertical-aspect layout looks much better, without the empty spot at the top.





Anyhow I get some weirdness with zoom-to-fill. The the roku device automagically update firmware or maybe i'm using png images and the machine doesn't like them for some reason. I actually plan on doing this the 'correct way' and cropping the images properly 🙂 luckily i already have horizontal hints to frame bodies, yay. So I probably won't actually need the zoom-to-fill, wondering if this is a bug?

0 Kudos
TheEndless
Channel Surfer

Re: Couple of Newbie Questions

"waitman" wrote:
So I probably won't actually need the zoom-to-fill, wondering if this is a bug?

It is a bug, and it's been around for a long time. zoom-to-fill only works on certain grid styles, though I don't recall which off the top of my head.
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
waitman
Channel Surfer

Re: Couple of Newbie Questions

Thanks, for all the replies, i totally appreciate the help.

The vertical poster images look _way_ better IMHO,

regarding the post about setting the focused item I see
Void SetFocusedListItem(Integer listIndex, Integer itemIndex)

But i don't seem to find reference to setting the grid spacing.. I think I'm probably OK on default spacing with the vertical poster though.

And I now see the tmp image download example in roAudioMetaDate --
http://sdkdocs.roku.com/display/RokuSDK ... ioMetadata

One question, there's a section in the design guide of the manual that describes an audio screen
http://sdkdocs.roku.com/display/RokuSDK ... yingScreen
it says 'see details screen'.. it's talking about http://sdkdocs.roku.com/display/RokuSDK ... oardScreen correct? or maybe i'm missing it.
thanks



making progress, still need to fix the logo.
0 Kudos
rohitkaushik
Visitor

Re: Couple of Newbie Questions

@waitman
Hey,

Did you get an answer to the issue regarding loading an image remotely (bitmap=CreateObject("roBitmap", "http://www.example.com/image.jpg")?
I'm running into the same issue.
means Can we show a image on roVideoScreen in case of audio.Is it possible?
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.