coldrain
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2017
08:03 PM
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?
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?
2 REPLIES 2
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2017
09:11 PM
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
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)
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.
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.
coldrain
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2017
02:24 AM
Re: How to enforce poster image reload?
Wonderful, it works as a charm. Thanks destruk