Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
schworak
Channel Surfer

How to detect a 404 error when loading a poster image?

Hello, I am new to Roku development and I have the hang of loading images from my server into a poster.

The one thing I can't seem to figure out at the moment is if for whatever reason, the request for the image fails (404 or 500 or anything other than 200), how can I detect that and deal with it?

Anyone have a sample or suggestion?

Tags (1)
0 Kudos
1 REPLY 1
schworak
Channel Surfer

Re: How to detect a 404 error when loading a poster image?

Figured it out. I can just monitor the state on the poster using myposter.observefield("state","myfunction") and it tells me loading, ready, failed.

Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!