Foros del Web » Programando para Internet » Javascript »

problemas con webcam

Estas en el tema de problemas con webcam en el foro de Javascript en Foros del Web. hola chicos, pues eso, he instalado una webcam en mi pagina web, pero ... cuando la gente se conecta solo les sale una x , ...
  #1 (permalink)  
Antiguo 05/01/2011, 05:14
 
Fecha de Ingreso: diciembre-2010
Ubicación: tenerife
Mensajes: 60
Antigüedad: 13 años, 4 meses
Puntos: 0
problemas con webcam

hola chicos, pues eso, he instalado una webcam en mi pagina web, pero ... cuando la gente se conecta solo les sale una x , y no entiendo el por q, seguramente sea un error de codigo, o eso creo yo, la webcam que me hace el streaming es webcamxp, y mi camara web es logitech, aqui os dejo el codigo a ver si se encuentra la solucion, gracias

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>retransmision</title>
</head>

<body>
<center>
<script type="text/javascript">
var height_array = new Array();
var width_array = new Array();
width_array[1] = 320;
height_array[1] = 240;
</script>
<img src="http://USUARIO-8E61834:8080/loading.jpg" class="webcam" id="webcam1" onmousedown="PTZMouseDown1(event)" width="990" height="575" alt="Live Stream" />
<script type="text/javascript">
<!--
currentCamera1= 1;
errorimg1= 0;
document.images.webcam1.onload = DoIt1;
document.images.webcam1.onerror = ErrorImage1;
function LoadImage1()
{
uniq1 = Math.random();
document.images.webcam1.src = "http://USUARIO-8E61834:8080/cam_" + currentCamera1 + ".jpg?uniq="+uniq1;
document.images.webcam1.onload = DoIt1;
}
function PTZMouseDown1(e)
{
var IE = document.all?true:false;
var x,y;
var myx,myy;
var myifr = document.getElementById("_iframe-ptz");
tp = getElPos1();
myx = tp[0];
myy = tp[1];
if(IE){
var scrollX = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
var scrollY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
x = event.clientX - myx + scrollX;
y = event.clientY - myy + scrollY;
} else {
x = e.pageX - myx;
y = e.pageY - myy;
}
if ((width_array[currentCamera1] != null) && (width_array[currentCamera1] > 0)) x = Math.round((x * 400) / width_array[currentCamera1]);
if ((height_array[currentCamera1] != null) && (height_array[currentCamera1] > 0)) y = Math.round((y * 300) / height_array[currentCamera1]);
if (x > 400) x = 400;
if (y > 300) y = 300;
if (myifr != null) myifr.src = "http://USUARIO-8E61834:8080/ptz?src=" + currentCamera1 + "&moveto_x=" + x + "&moveto_y=" + y +"";
return true;
}
function getElPos1()
{
el = document.images.webcam1;
x = el.offsetLeft;
y = el.offsetTop;
elp = el.offsetParent;
while(elp!=null)
{ x+=elp.offsetLeft;
y+=elp.offsetTop;
elp=elp.offsetParent;
}
return new Array(x,y);
}
function ErrorImage1()
{
errorimg1++;
if (errorimg1>3){
document.images.webcam1.onload = "";
document.images.webcam1.onerror = "";
document.images.webcam1.src = "offline.jpg";
}else{
uniq1 = Math.random();
document.images.webcam1.src = "http://USUARIO-8E61834:8080/cam_" + currentCamera1 + ".jpg?uniq="+uniq1;
}
}
function DoIt1()
{
errorimg1=0;
window.setTimeout("LoadImage1();", 40);
}
//-->
</script>

</center>
</body>
</html>
  #2 (permalink)  
Antiguo 05/01/2011, 11:01
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Tema movido desde PHP a Javascript
  #3 (permalink)  
Antiguo 06/01/2011, 13:35
4ng3r
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: problemas con webcam

Los usuarios que la estan probando, estan por Internet o desde un LAN ... digame el por que de esta ruta http://USUARIO-8E61834:8080/... y otra cosa revisese este plug para JQuery sirve para desplegar la webcam usando un componente hecho en Flash

http://www.xarg.org/project/jquery-webcam-plugin/

Etiquetas: webcam
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:31.