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

Setting images from a URL not PKG

Hi all,

What is the proper syntax for calling a image file that is not hosted within the project? I know in the example projects there are images in folders, but if I want to link to one that's hosted at BrightCove, what would be the proper way to do that?

ABBREVIATED EXAMPLE

Sub initTheme()

app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")
theme.OverhangSliceSD = "pkg:/images/Overhang_BackgroundSlice_Blue_SD43.png" '<<==NORMAL WAY TO SET IMAGES
theme.OverhangLogoSD = <WHAT URL FORMATTING GOES HERE??>
app.SetTheme(theme)

End Sub


I tried several different combinations and they all didn't seem to work.

Thanks
Bud
0 Kudos
16 REPLIES 16
stratcat96
Visitor

Re: Setting images from a URL not PKG

Are you trying to set a non-locally hosted overhang logo pic? You're really better off snagging it from the web and editing it yourself to make sure that you get it the right size so it will display correctly. Other than exacting size specifications in theme- work, you can set image url for poster screens, spring boards, etc. just by using the url. Those objects don't have strict dimension requirements like your theme pics
0 Kudos
brocker
Visitor

Re: Setting images from a URL not PKG

I was actually trying to offload as many images as I could as I read there is a limitation to what can be saved to the Roku, and they suggested hosting them elsewhere if you have a bunch (which I will). I already got a couple of warnings when side loading the project that I'm going over on size.

I had our graphic artist go through and make images as per dimensional guidelines, now was hoping to host them at BrightCove.

Thanks
Bud
0 Kudos
jbrave
Channel Surfer

Re: Setting images from a URL not PKG

Overhangs HAVE to be hosted in the .pkg, poster images and most others can be hosted anywhere. You can however use the download function to download the overhang locally to the box and then use it for an overhang, although I haven't tested that this works.
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
kbenson
Visitor

Re: Setting images from a URL not PKG

There's a 500k soft limit, and 2000K hard limit to channels (after zip conpression). If it's a core part of the channel, I suggest including it in the package. If it's dynamic in nature, then yes, definitely offload it.

Last I heard not all components allowed remote URLs to be used to define the files, but in that case you can use an roURLTransfer to download it to a file in tmp:/ and reference it there. If it's part of the initial screen, and you still want to remotely reference it, I suggest displating some sort of splash screen while that's happening.
-- GandK Labs
Check out Reversi! in the channel store!
0 Kudos
stratcat96
Visitor

Re: Setting images from a URL not PKG

"brocker" wrote:
I was actually trying to offload as many images as I could as I read there is a limitation to what can be saved to the Roku, and they suggested hosting them elsewhere if you have a bunch (which I will). I already got a couple of warnings when side loading the project that I'm going over on size.

I had our graphic artist go through and make images as per dimensional guidelines, now was hoping to host them at BrightCove.

Thanks
Bud


Those theme files should be so small in size that really it's not worth going to the trouble of keeping it out of the package. If you were even able to put all image data off-site, if the channel were to have connection issues, or the box itself had connection issues when the user opened it, only a skeleton-like frame would show in the channel and kind of look crappy if you know what I mean.
gonzotek
Visitor

Re: Setting images from a URL not PKG

"brocker" wrote:
Hi all,

What is the proper syntax for calling a image file that is not hosted within the project? I know in the example projects there are images in folders, but if I want to link to one that's hosted at BrightCove, what would be the proper way to do that?

ABBREVIATED EXAMPLE


Sub initTheme()

app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")
theme.OverhangSliceSD = "pkg:/images/Overhang_BackgroundSlice_Blue_SD43.png" '<<==NORMAL WAY TO SET IMAGES
theme.OverhangLogoSD = <WHAT URL FORMATTING GOES HERE??>
app.SetTheme(theme)

End Sub


I tried several different combinations and they all didn't seem to work.

Thanks
Bud
Some good advice from the other posters, and here's some example code

http = CreateObject("roUrlTransfer")
http.SetPort(CreateObject("roMessagePort"))
http.SetUrl("http://yourserver.com/yourpath/yourimage.png")
http.GetToFile("tmp:/yourimage.png")
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
gonzotek
Visitor

Re: Setting images from a URL not PKG

"stratcat96" wrote:
"brocker" wrote:
I was actually trying to offload as many images as I could as I read there is a limitation to what can be saved to the Roku, and they suggested hosting them elsewhere if you have a bunch (which I will). I already got a couple of warnings when side loading the project that I'm going over on size.

I had our graphic artist go through and make images as per dimensional guidelines, now was hoping to host them at BrightCove.

Thanks
Bud


Those theme files should be so small in size that really it's not worth going to the trouble of keeping it out of the package. If you were even able to put all image data off-site, if the channel were to have connection issues, or the box itself had connection issues when the user opened it, only a skeleton-like frame would show in the channel and kind of look crappy if you know what I mean.
It *could* be coded to have fall back files in the package, if the hosted ones are unavailable.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
stratcat96
Visitor

Re: Setting images from a URL not PKG

"gonzotek" wrote:
"stratcat96" wrote:
"brocker" wrote:
I was actually trying to offload as many images as I could as I read there is a limitation to what can be saved to the Roku, and they suggested hosting them elsewhere if you have a bunch (which I will). I already got a couple of warnings when side loading the project that I'm going over on size.

I had our graphic artist go through and make images as per dimensional guidelines, now was hoping to host them at BrightCove.

Thanks
Bud


Those theme files should be so small in size that really it's not worth going to the trouble of keeping it out of the package. If you were even able to put all image data off-site, if the channel were to have connection issues, or the box itself had connection issues when the user opened it, only a skeleton-like frame would show in the channel and kind of look crappy if you know what I mean.
It *could* be coded to have fall back files in the package, if the hosted ones are unavailable.



it could, but then that's defeating the intended purpose of moving images out of the package and only saves the space difference between the two sets of images, and adds to the work
0 Kudos
gonzotek
Visitor

Re: Setting images from a URL not PKG

"stratcat96" wrote:
it could, but then that's defeating the intended purpose of moving images out of the package and only saves the space difference between the two sets of images, and adds to the work
True, if the purpose is space-saving. I was thinking of dynamic theming. And wouldn't really be that much work.
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.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.