Webcam Script

Webcam script 1

How to Put a Web Cam on Your Site :

Putting a webcam on your site is a great way to build followers that help increase your popularity on the Internet. There are two ways to stream your webcam online: use an external service or hand-code the script if you are proficient in HTML. Following the steps assumes you have connected a webcam to your computer.

One simple way to implement a webcam page without using Flash, Java applets, or ActiveX controls is to use a little bit of JavaScript to repeatedly pull an image from the server. You vary the URI by adding a changing value as a parameter to help defeat caching.

This version actually waits for the image to load before starting a one-shot “wait” and then pulling a new frame. New load, new “wait” and re-pull.

<html> <head> <title>Motion Cam</title> <script language=”JavaScript” defer=”true”> function FrameLoaded() { window.setTimeout(ReloadFrame, 1500); }; function ReloadFrame() { var d;
d=new Date(); document.getElementById(“webcam”).src=”motion.jpg?”+d.getTime(); }; </script> </head> <body> <img id=”webcam” src=”motion.jpg?” alt=”motion camera image” onload=”FrameLoaded()”> </body> </html>

Comments are closed.