Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
jisa
Level 7

setlayer and 404 image url

How to ask roku to avoid or skip the image urls which have an error for the canvas setlayer api?
0 Kudos
3 Replies
jisa
Level 7

Re: setlayer and 404 image url

Can setlayer display a default image on image url failure?
0 Kudos
renojim
Level 8

Re: setlayer and 404 image url

Check the URL before you use it (e.g., with roUrlTransfer.Head()) and then you can set the URL you use with SetLayer to a default image included in your package if its not available.

-JT
0 Kudos
Roku Employee
Roku Employee

Re: setlayer and 404 image url

"jisa" wrote:
Can setlayer display a default image on image url failure?


There isn't any built-in support for that in roImageCanvas, that I know of.

If your target image is opaque, you could put a placeholder image at the same target rectangle, so that if the image load is successful it will overlay it, but if it fails it would just show the placeholder.
0 Kudos