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: 
joe_haase
Visitor

Image reload on Videoplayer example

So I'm a Noob here, but not totaly clueless with programming..

I am modifying my videoplayer example as a proof of concept piece, and have hit a wall.... under the categories, I have changed one to point to webcams around my neighborhood. We are using axis cameras, that have a direct path to return a jpg image. We have the image path loading up in the XML file, and shows up perfectly when the channel is loaded into the roku.

the problem I have is that I can't figgure out how to make the image refresh, or reload, every few seconds for example. It still shows the original pictures of night time when I loaded up the channel last night.

Any thoughts or tips would be greatly appreciated.
0 Kudos
6 REPLIES 6
hoffmcs
Visitor

Re: Image reload on Videoplayer example

The Roku caches images so if the url is not changing, it will show the same image. Check out this post about generating a unique url to force the reload of the image.

viewtopic.php?f=34&t=32159&p=202936#p202936
0 Kudos
joe_haase
Visitor

Re: Image reload on Videoplayer example

hoffmcs.... thanks for the response... that solves one of my problems!!!

Atleast the image will reload everytime I launch the channel.... but there is any way of refreshing the images while the program is running?? Say every 2 minutes or so???
0 Kudos
hoffmcs
Visitor

Re: Image reload on Videoplayer example

Most screens on the Roku use a simple while loop. If you are not processing screen messages (like remote buttons, except Home which will kill the app), a simple sleep will work. If you are, you can replace it with some counter or a wait function (eg. msg = wait(120000, screen.GetMessagePort()))

while true
'Load image

sleep 120000 '2 minutes
end while
0 Kudos
joe_haase
Visitor

Re: Image reload on Videoplayer example

I got it...I think.... 🙂

I'm not used to writing code with no compiler or IDE.... I find myself lost trying to find one small sintax that keeps the whole thing from running..
0 Kudos
dynamitemedia
Binge Watcher

Re: Image reload on Videoplayer example

"joe.haase" wrote:
I got it...I think.... 🙂

I'm not used to writing code with no compiler or IDE.... I find myself lost trying to find one small sintax that keeps the whole thing from running..



I used to do it without the debugger!! yes the code is confusing at times and something simple will kill it quick! but the debugger will at least tell you where its at.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
joe_haase
Visitor

Re: Image reload on Videoplayer example

I just learned the debugger about 10 mins ago... and so far it's making life a little better. I still can't see where the images get loaded from the lower array (childleaf). I see where everything else comes in. I tried using the getunixtime(), and it posted a bunch of errors, so I swapped it out with a rnd(4500) to pull a random number.



Now I just need to get my Wowza live stream and I'm in business... All I need is a proof of concept to get things going, then we will probably have a seasoned developer put everything together!
0 Kudos