//ActiveX Object Defines var AXOBJECT_ID = "AxMediaControl"; var AXOBJECT_PATH = "AxViewer/"; var AXOBJECT_NAME = "AxMediaControl.cab"; var AXOBJECT_VER = "2,0,84,4274"; var user = SendCGICMD("/cgi-bin/view/hello"); var TEMP_USER_NAME = GetQueryVariableEx2("UserName", user); var TEMP_PASSWORD = GetQueryVariableEx2("Password", user); // do NOT change these two lines //var GET_USER_NAME = ""; //var GET_PASSWORD = ""; // do NOT change these two lines //Video Stream Defines var PROFILE = "0"; var PROTOCOL_TYPE = "3"; //(set as cookie on client PC) 1->TCP, 2->UDP, 3->HTTP 4->Multicast ,default connect order TCP->UDP->HTTP var g_szProtocolType = "3"; var MPEG4_ACCESS_NAME = "video.mp4"; var MJPEG_ACCESS_NAME = "video.mjpg"; var MULTICAST_ACCESS_NAME = "multicast.mp4"; var RECORDER_SUPPORT = "1"; var VIDEO_FMT = 1; var PLUGIN_LANG=0; var INITMODE = "none"; var CAPTEXT = "Live view"; var STATUSBAR = 0; var TOOLBAR = 0; var TOOLTIP = 0; var CONTEXTMENU = 0; var TOOLBARCONF = "stream+rec+mic+zoom+time"; var AUTOSTART = 0; var VIEW_SIZE = "320x240"; var vdoWidth = 710; var vdoHeight = 410; var Buffer_Enable = getBufferEn(); var _platform = navigator.platform; var HOST_NAME=location.hostname; var HOST_PORT = location.port; var HOST_SSL_PORT = 0; var HOST_PROTOCOL = location.protocol; var PUPOPS = 0; var ADVANCED = 0; var RecordSize = 200; if(HOST_PROTOCOL=="https:") { if(HOST_PORT==0 || HOST_PORT=="") HOST_SSL_PORT = 443; else HOST_SSL_PORT = HOST_PORT; } if(HOST_PORT==0 || HOST_PORT=="") HOST_PORT = 80; //default port var mydate = new Date(); var imgURL; var imgSrc = new Image(); GetDeviceInfo('Properties.Firmware.ActiveXID&group=Properties.PTZ.PTZ&group=General.Network&group=ImageSource.RecordIndex','view'); var CLASS_ID=GetQueryVariable('Properties.Firmware.ActiveXID'); var PTZSupport=GetQueryVariable('Properties.PTZ.PTZ'); var PTZMouseCtl = 0; var RTSP_PORT = GetQueryVariable('General.Network.RTSP.Port'); var RecordIndex = GetQueryVariable('ImageSource.RecordIndex'); function SetPTZMouseCtrl() { if(PTZtype=="ExtPTZ" || PTZtype == "PT") { PTZMouseCtl = 1; }else{ PTZMouseCtl = 0; } } function RGB(r,g,b) { return (b*65536+g*256+r); } function refreshImg() { var imgObj = document.getElementById('jpeg'); var newURL; if (imgObj) { newURL = '/cgi-bin/view/image?pro_' + RecordIndex + '&' + (new Date()).getTime(); imgObj.src = newURL; imgObj.onload=refreshImg; imgObj.onerror=refreshImg; } } function DispImage() { var imgObj = document.getElementById('jpeg'); imgObj.src=imgURL; } function Viewer() { if( getOs().indexOf("IE") >= 0 ){ SetPTZMouseCtrl(); document.open(); if(STATUSBAR==1) vdoHeight+=25; if(TOOLBAR==1) vdoHeight+=30; document.write(""); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(""); document.close(); }else{ if(INITMODE == "md" || INITMODE == "ad" || INITMODE == "mask") { return; }else{ document.open(); document.write(""); document.close(); imageProfile = RecordIndex; updateImgByProfile("jpeg"); } } } function NormalViewer(width,height) { if(_platform.toLowerCase().indexOf("mac") >= 0) { if(VIEW_SIZE == "Large") {AppletWidth=640;AppletHeight=(480+58);vdoWidth=640;vdoHeight=480;} else if(VIEW_SIZE == "Medium") {AppletWidth=320;AppletHeight=(240+58);vdoWidth=320;vdoHeight=240;} else {AppletWidth=320;AppletHeight=315;} document.writeln(''); document.writeln('<applet NAME="ObjJavaCam" CODE = "IPCam.CamMain2.class" JAVA_CODEBASE = "./java/" WIDTH = '+AppletWidth+' HEIGHT = '+AppletHeight+' MAYSCRIPT>'); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.writeln(''); document.close(); } else { if(STATUSBAR==1) height+=25; if(TOOLBAR==1) height+=28; document.write(""); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(""); document.close(); } } function RemoteViewer(width,height,FILE_PATH) { if(STATUSBAR==1) height+=25; if(TOOLBAR==1) height+=28; document.open(); document.write(""); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); // IPv6 if(HOST_NAME.indexOf(":") != -1) { // [ exist if(HOST_NAME.indexOf("[") != -1) { document.write(" "); // [ not exist }else{ document.write(" "); } // IPv4 }else{ document.write(" "); } document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(" "); document.write(""); document.close(); } function onAxobjUnload() { if(AxMediaControl.UIMode) { AxMediaControl.StopRecord(); AxMediaControl.Stop(); //setProtocol(AxMediaControl.MediaProtocol); } }