HTTP does not refresh

Report and discuss bugs here!
Post Reply
Mike Scott
Posts: 30
Joined: Fri Feb 15, 2013 6:47 pm

HTTP does not refresh

Post by Mike Scott »

In the file /.yawcam/update.html there is no code to update the web page. So it just loads 1 static pic and stops. I added this, which refreshes just the pic not the whole page. by changing the var n, you can dynamically change the FPS

//Add id='pic' to the <img that holdsthe image. And add the js

<script type="text/javascript">
var n=1000 // will work as low as 100. in msec.
function refresh(){
document.images["pic"].src="out.jpg"
setTimeout("refresh()",n)
}
setTimeout("refresh()",1000)
</script>
malun
Site Admin
Posts: 1589
Joined: Sun Jan 04, 2004 1:29 pm

Re: HTTP does not refresh

Post by malun »

Doesn't the image get updated when the page reloads?
What web browser are you using?

It works fine for me in the browsers I've tried:

In windows:
Chrome, Firefox, Opera, Internet Explorer

In OSX:
Safari

In Android:
Chrome

In iOS:
Safari
Chrome

/malun
Mike Scott
Posts: 30
Joined: Fri Feb 15, 2013 6:47 pm

Re: HTTP does not refresh

Post by Mike Scott »

The image refreshes now I have some code to refresh. Problem was there was nothing to refreah the page. The code I added (above) has the advantage of just refreshing the img so there is no page flicker (as occures sometimes when refreshing the whole page), and if the page has a lot of other stuff on it, that will not get reloaded n x per sec (keeps the Kbps down and enables a [marginally] faster refresh rate)
z3r0c00l12
Moderator
Posts: 1210
Joined: Wed Jan 14, 2009 3:50 am

Re: HTTP does not refresh

Post by z3r0c00l12 »

My update.html page has "<meta http-equiv=Refresh content="10">" to refresh every 10 seconds.
malun
Site Admin
Posts: 1589
Joined: Sun Jan 04, 2004 1:29 pm

Re: HTTP does not refresh

Post by malun »

Ah, yep. To get the javascript update: Use the stream output (and you can set it to 1 FPS if you want to).

/malun
pcxterminator
Posts: 1
Joined: Sun Mar 19, 2023 5:24 am

Re: HTTP does not refresh

Post by pcxterminator »

I am new to javascript editing, am I missing where this update goes?

I can view my camera one image at a time and refresh the page to see the updates.

I have it working local and remotely, but it will not automatically refresh the image unless I reload the page.

Unfortunately with my setup, it took me the better part of about 5 hours to get to this point. (No thanks to a cheaper router that needed OpenWRT installed and setup to get port forwarding working correctly)

Any help will be greatly appreciated!

Thanks!
Post Reply