17/02/2010, 22:10
|
| | | Fecha de Ingreso: marzo-2006
Mensajes: 38
Antigüedad: 18 años, 11 meses Puntos: 3 | |
Respuesta: Sistema de camaras en web Bueno paso a dar la autorespuesta
logre solucionar mi problema, y paso a dejar el codigo completo que use para poder
poner los 3 videos, y la seleccion de los mismos
con una mascara de codigo, Espero que a algun desamparado le sirva ;D
Código HTML:
Ver original<script language="Javascript"> function aparecer(id) { var d = document.getElementById(id); d.style.display = "block"; d.style.visibility = "visible"; } function ocultar(id) { var d = document.getElementById(id); d.style.display = "none"; d.style.visibility = "hidden"; } window.onload = function () { //Al cargar la página se oculta el div de consulta ocultar("jpg"); ocultar("flash"); } <a href="#java" onClick="ocultar('jpg');ocultar('flash');aparecer('java');">Java </a> - <a href="#jpg" onClick="ocultar('java');ocultar('flash');aparecer('jpg');">Jpg </a> - <a href="#flash" onClick="ocultar('java');ocultar('jpg');aparecer('flash');">Flash </a> - <div id="java" style="position:absolute;text-align:center;top:100px;left:200px;border:solid 1px red;"><img src="http://anicomics.dyndns.org:8080/loading.jpg" class="webcam" id="webcam1" onMouseDown="PTZMouseDown1(event)" width="320" height="240" 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://anicomics.dyndns.org: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] > 0) x = Math.round((x * 400) / width_array[currentCamera1]); if (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://anicomics.dyndns.org: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://anicomics.dyndns.org:8080/cam_" + currentCamera1 + ".jpg?uniq="+uniq1; } } function DoIt1() { errorimg1=0; window.setTimeout("LoadImage1();", 40); } //--> <div id="jpg" style="position:absolute;text-align:center;top:100px;left:200px;border:solid 1px red;"><img src="http://anicomics.dyndns.org:8080/cam_1.cgi" class="webcam" id="webcam1" onMouseDown="PTZMouseDown1(event)" width="320" height="240" alt="Live Stream" /> <script type="text/javascript"> <!-- currentCamera1= 1; 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){ x = event.clientX - myx + document.body.scrollLeft; y = event.clientY - myy + document.body.scrollTop; } else { x = e.pageX - myx; y = e.pageY - myy; } //alert(x + " :: " + y); if (width_array[currentCamera1] > 0) x = Math.round((x * 400) / width_array[currentCamera1]); if (height_array[currentCamera1] > 0) y = Math.round((y * 300) / height_array[currentCamera1]); //alert(x + " :: " + y); if (myifr != null) myifr.src = "http://anicomics.dyndns.org: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); } //--> <div id="flash" style="position:absolute;text-align:center;top:100px;left:200px;border:solid 1px red;"><object type="application/x-shockwave-flash" width="320" height="240" data="../webcamxp.swf"> <param name="movie" value="webcamxp.swf?webcam=http://anicomics.dyndns.org:8080/cam_1.jpg&refresh=50&connect=&offline=&transtype=Fade&bgcolor=#FFFFFF&txtcolor=#808080" /> <param name="FlashVars" value="webcam=http://anicomics.dyndns.org:8080/cam_1.jpg&refresh=50&connect=&offline=&transtype=Fade&bgcolor=#FFFFFF&txtcolor=#808080" /> <param name="loop" value="false" /> <param name="menu" value="false" /> <param name="quality" value="best" /> <param name="scale" value="noscale" /> <param name="salign" value="lt" /> <param name="wmode" value="opaque" />
|