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: 
coldrain
Level 7

How to enforce poster image reload?

Hi everyone,

I'm making a channel with live video, so I generate a thumbnail image frequently (such as every 5 or 10 minutes) and store it at a given URL. I have a Poster (for the live video) use that thumbnail and I set the poster.url to the defined link (poster.uri = link). I want the poster update every time user go to that screen but look like the image is cached and it never download again. Can anyone tell me how to solve it?
0 Kudos
2 Replies
destruk
Level 10

Re: How to enforce poster image reload?

You can probably do this by adding a parameter to the url string for the poster image.  On roku, generate a timestamp and add it to the url.
dt=createobject("roDateTime")
value=dt.AsSeconds()
transferstringurl=transferstringurl+"?ts="+value.toStr()
ie
http://myservername.com/images/myposter.jpg?ts=1494302631


Or you could modify the headers - (not sure if it works from roku's client side, but it'd be something to set on the server side)
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

You'd need to update the hdposterurl and sdposterurl for the item every time you want the poster to change, and you'll need to update all displayed content lists with the new data whether their screens are visible or not, to be sure it propagates the new image to everything (to be on the safe side) - or maybe you won't depending on how your code is set.
0 Kudos
coldrain
Level 7

Re: How to enforce poster image reload?

Wonderful, it works as a charm. Thanks destruk
0 Kudos