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?

Can setlayer display a default image on image url failure?

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

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