G
Guest
Hello,
I am making a web page where I need to show somewhere in the page a webcam
without component like activex.
In my webcam I can read the last picture with the following command:
http://192.168.1.34/jpg/image.jpg
I have a img tag in my web page where I show the last picture. But I don't
want to refresh the web page all the time to show my webcam and for that I
made a javascript that read the picture:
function mycamera() {
document.getElementById('camera').src = 'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("camera",1000);
}
But the behavior is not the same than when I refresh the page, because it
show me always the same picture, but if in another web page I read the webcam
picture (with a refresh of the page) in the first web page I have the new
picture.
I think the webcam generate a new picture with a http request, and I try to
do a function in the web server wich read cyclic the picture:
public void RefreshCamera(Object source, System.Timers.ElapsedEventArgs e)
{
WebClient Client = new WebClient();
byte[] image =
Client.DownloadData("http://192.168.1.34/jpg/image.jpg");
aTimer.Start();
}
but the webcam do not generate a new picture.
Thanks for your help.
I am making a web page where I need to show somewhere in the page a webcam
without component like activex.
In my webcam I can read the last picture with the following command:
http://192.168.1.34/jpg/image.jpg
I have a img tag in my web page where I show the last picture. But I don't
want to refresh the web page all the time to show my webcam and for that I
made a javascript that read the picture:
function mycamera() {
document.getElementById('camera').src = 'http://192.168.1.34/jpg/image.jpg';
timerID = setTimeout("camera",1000);
}
But the behavior is not the same than when I refresh the page, because it
show me always the same picture, but if in another web page I read the webcam
picture (with a refresh of the page) in the first web page I have the new
picture.
I think the webcam generate a new picture with a http request, and I try to
do a function in the web server wich read cyclic the picture:
public void RefreshCamera(Object source, System.Timers.ElapsedEventArgs e)
{
WebClient Client = new WebClient();
byte[] image =
Client.DownloadData("http://192.168.1.34/jpg/image.jpg");
aTimer.Start();
}
but the webcam do not generate a new picture.
Thanks for your help.