|
Nota Técnica: Fotos en línea
La información en este artículo se aplica a:
- AXIS 2100/2120/2400/2401/2420 desde la versión de firmware
2.12
Resumen
Este artículo muestra como incluir en una página web una foto
generada por una Cámara de Red Axis.
Más información
Algunos navegadores manejan el caché de imágenes de manera
distinta a como lo hacen con páginas de texto o html. Muestran las
imágenes en caché sin importar que hayan sido cambiadas en el
servidor o no. Puesto que las Cámaras de Red Axis siempre
suministran imágenes actualizadas en vivo, usted podría ver en
algunos navegadores imágenes viejas almacenadas en caché cuando
regrese a la página. En el ejemplo siguiente se muestra como evitar
esto usando un parámetro CGI falso. La página html de ejemplo
también incluye una mega etiqueta que recargará automáticamente la
página cada 30 segundos.
Ejemplo
<html>
<head>
<META http-equiv="Refresh" content="30">
<!-- The Meta tag above makes this page refresh every 30 seconds
-->
<!-- Change the number 30 into your desired refresh rate or
remove this -->
<!-- Tag if you do not want the page to refresh automatically
-->
<title>JPG Image Demo</title>
</head>
<body>
<center>
<h2>JPEG image</h2>
<!-- Cut from here to the end of image display comment -->
<!-- Note: If you do not see a JavaScript below in the view
source window you must -->
<!-- first save the html file from your browser, then open the
saved -->
<!-- file in a text editor, for instance Notepad.-->
<SCRIPT LANGUAGE="JavaScript">
// Set the BaseURL to the url of your camera
// Example: var BaseURL = "http://172.21.1.122/";
var BaseURL = "http://[myCamera]/";
// The two following lines need to be changed if an AXIS 2400 is
used:
var Camera = ""; // If you use an AXIS 2400, comment away this
line by inserting "//"
// var Camera = "n"; // Change n to the Video source used in the
AXIS 2400 and remove "//"
// Go to the camera used and remove the "//" in front of the
ImageResolution to be used.
// Note that only one can be enabled.
// AXIS 2100
// var ImageResolution = "320x240";var DisplayWidth = "320";var
DisplayHeight = "240";
// var ImageResolution = "640x480";var DisplayWidth = "640";var
DisplayHeight = "480";
// AXIS 2120/2400/2401/2420 PAL
// var ImageResolution = "352x288";var DisplayWidth = "352";var
DisplayHeight = "288";
// var ImageResolution = "704x576";var DisplayWidth = "704";var
DisplayHeight = "576";
// AXIS 2120/2400/2401/2420 NTSC
// var ImageResolution = "352x240";var DisplayWidth = "352";var
DisplayHeight = "240";
// var ImageResolution = "704x480";var DisplayWidth = "704";var
DisplayHeight = "480";
// No changes required below this point
var File = "axis-cgi/jpg/image.cgi?resolution=" +
ImageResolution;
if (Camera != "") {File += "&camera=" + Camera;}
theDate = new Date();
var output = "<IMG SRC=\"";
output += BaseURL;
output += File;
output += "&dummy=";
output += theDate.getTime().toString(10);
// The above dummy cgi-parameter enforce a bypass of the browser
image cache.
output += "\" HEIGHT=\"";
output += DisplayHeight;
output += "\" WIDTH=\"";
output += DisplayWidth;
output += "\" ALT=\"Live Image\">";
document.write(output);
</script>
<!-- End of image display part -->
</body>
</html> |
Axis no se hace responsable por la manera en que estos cambios
de configuración puedan afectar su sistema. Si la modificación
falla o si se obtienen resultados inesperados, usted puede restaurar
su equipo a los valores de fábrica según se describe en el Manual de
Usuario. |