Monday, March 28, 2011

Webcam Timer

I choose to have a very basic setting to broadcast my webcam to the internet.
The webcam software will capture an image every 5 seconds and saves to c:\inetpub\wwwroot\mypic.jpg which is my winXP webserver

1. webcam software - Yawcam
www.yawcam.com

2. java script to autorefresh every 5 second. Paste this in your html file.

[script language="javascript"]
var refreshrate=5;
var image="mypic.jpg";

function refresh(){
document.images["pic"].src=image+"?"+new Date();
setTimeout('refresh()', refreshrate*1000);}
document.write('[IMG SRC="'+image+'" ALT="Alternate Text" NAME="pic" ID="pic" STYLE="border: 1px solid Black;"]');
if(document.images)window.onload=refresh;
[/script]

*note: replace [ ] at script and IMG tag with < >

1 Comments:

Blogger RayRosli Abas said...

instead of yawcam, i'm using Fwink will seems to be better apps

9:13 AM  

Post a Comment

<< Home