View Full Version : checking if web cam image is finished loading

08-05-2002, 03:08 PM

I wonder if this is possible. I have a webcam application with a live stream.

I can't get the front-end applet to work so I am trying to do something with javascript.

the end user connects directly to the machine with the web cam through a port:


To get the fastest stream possible it is necessary to check if the current frame/jpg has finished loading so the next image can start loading. The problem is that images are not cached.

Can this still be done and how to set it up?

08-07-2002, 04:37 AM
Image has a boolean property, called "complete", which tells you if the image has finished loading or not.

however, a better way to do it, would be to use the "onload" event of the image. everytime the image finishes loading, you can refresh the page.

document.images["picture"].onload= function() {

08-07-2002, 03:22 PM
Thanks John,

Actually I was trying all sort of things and what I ended up with is almost similar as your solution.


<img name="image1" src="image.jpg" onLoad="newImage()">

works quite well as I use two layers on top of eachother to prevent the image from blinking during loading. When the image is finished loading the layer is made visible and loading of the new image in the other layer is started.