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: 
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?

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.

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.