!function(){if(!window.WebVideoCtrl){var e=function(){var h="100%",f="100%",u="",c="";oSecurityCap={};var p={szContainerID:szAESKey="",szColorProperty:"",szOcxClassId:"clsid:FDF0038A-CF64-4634-81AB-80F0A7946D6C",szMimeTypes:"application/webvideo-plugin-kit",szBasePath:"",iWndowType:1,iPlayMode:2,bWndFull:!0,iPackageType:2,bDebugMode:!1,bNoPlugin:!0,cbSelWnd:null,cbDoubleClickWnd:null,cbEvent:null,cbRemoteConfig:null,cbInitPluginComplete:null,proxyAddress:null},y=null,P=0,s=!1,I=[],m=[],t=null,S=null,C=null,v=null,o=this,g=null,x=1,d="IPCamera",D="IPDome",z="IPZoom";window.GetSelectWndInfo=function(e){if(Z()){P=e,(t=[]).push(""),t.push(""+e+""),t.push(""),p.cbSelWnd&&p.cbSelWnd(v.loadXML(t.join("")))}else{var t,n=v.loadXML(e);if(0"),t.push(""+P+""),t.push(""),p.cbSelWnd&&p.cbSelWnd(v.loadXML(t.join("")));else if(0";else for(var t=navigator.mimeTypes.length,n=0;n");return e},R=function(){if(!Z()&&null!==y){var e=y.HWP_GetLocalConfig();g=v.loadXML(e)}},w=function(s){o.I_GetDeviceInfo(s.szIP,{success:function(e){s.szDeviceType=re.$XML(e).find("deviceType").eq(0).text()}}),o.I_GetAnalogChannelInfo(s.szIP,{success:function(e){}}),o.I_GetAudioInfo(s.szIP,{success:function(e){var t=re.$XML(e).find("audioCompressionType",!0);if(0","4","Invalid Operation","notSupport","",v.loadXML("4Invalid OperationnotSupport")};this.I_SupportNoPlugin=function(){return Z()},this.I_DestroyWorker=function(){null!==y&&Z()&&y.JS_DestroyWorker()},this.I_Resize=function(e,t){null!==y&&Z()&&(h=e,f=t,y.JS_Resize(e,t))},this.I_InitPlugin=function(e,t,n){if(h=e,f=t,v.extend(p,n),Z()){var r=v.getDirName();r&&("object"==typeof exports&&"undefined"!=typeof module||("function"==typeof define&&define.amd?require([r+"/jsPlugin-1.2.0.min.js"],function(e){window.JSPlugin=e.JSPlugin,n.cbInitPluginComplete&&n.cbInitPluginComplete()}):v.loadScript(r+"/jsPlugin-1.2.0.min.js",function(){n.cbInitPluginComplete&&n.cbInitPluginComplete()}))),M(document.fullScreen)?M(document.webkitIsFullScreen)?M(document.mozFullScreen)||document.addEventListener("mozfullscreenchange",function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;s&&!t&&window.KeyBoardEventInfo(100)}):document.addEventListener("webkitfullscreenchange",function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;s&&!t&&window.KeyBoardEventInfo(100)}):document.addEventListener("fullscreenchange",function(e){var t=document.fullscreen||document.webkitIsFullScreen||document.mozFullScreen||!1;s&&!t&&window.KeyBoardEventInfo(100)}),window.addEventListener("unload",function(){null!==y&&y.JS_DestroyWorker()})}else n.cbInitPluginComplete&&n.cbInitPluginComplete()},this.I_InsertOBJECTPlugin=function(e){if(M(e)||(p.szContainerID=e),null==document.getElementById(p.szContainerID))return-1;if(null!=document.getElementById(u)||0!=document.getElementsByName(u).length)return-1;if(Z()){var t={szId:e,iType:1,iWidth:h,iHeight:f,iMaxSplit:4,iCurrentSplit:p.iWndowType,szBasePath:v.getDirName()},n=p.szColorProperty;if(""!=n){for(var r={},s=n.split(";"),o="",i=0,a=s.length;i"),n.push(""+re.$XML(g).find("ProtocolType").eq(0).text()+""),n.push(""+re.$XML(g).find("PackgeSize").eq(0).text()+""),n.push(""+re.$XML(g).find("PlayWndType").eq(0).text()+""),n.push(""+re.$XML(g).find("BuffNumberType").eq(0).text()+""),n.push(""+re.$XML(g).find("RecordPath").eq(0).text()+""),n.push(""+re.$XML(g).find("CapturePath").eq(0).text()+""),n.push(""+re.$XML(g).find("PlaybackFilePath").eq(0).text()+""),n.push(""+re.$XML(g).find("PlaybackPicPath").eq(0).text()+""),n.push(""+re.$XML(g).find("DeviceCapturePath").eq(0).text()+""),n.push(""+re.$XML(g).find("DownloadPath").eq(0).text()+""),n.push(""+re.$XML(g).find("IVSMode").eq(0).text()+""),n.push(""+re.$XML(g).find("CaptureFileFormat").eq(0).text()+""),n.push(""),e=v.loadXML(n.join(""))},this.I_SetLocalCfg=function(e){if(Z())return-1;var t=v.loadXML(e);return re.$XML(g).find("ProtocolType").eq(0).text(re.$XML(t).find("ProtocolType").eq(0).text()),re.$XML(g).find("PackgeSize").eq(0).text(re.$XML(t).find("PackgeSize").eq(0).text()),re.$XML(g).find("PlayWndType").eq(0).text(re.$XML(t).find("PlayWndType").eq(0).text()),re.$XML(g).find("BuffNumberType").eq(0).text(re.$XML(t).find("BuffNumberType").eq(0).text()),re.$XML(g).find("RecordPath").eq(0).text(re.$XML(t).find("RecordPath").eq(0).text()),re.$XML(g).find("CapturePath").eq(0).text(re.$XML(t).find("CapturePath").eq(0).text()),re.$XML(g).find("PlaybackFilePath").eq(0).text(re.$XML(t).find("PlaybackFilePath").eq(0).text()),re.$XML(g).find("DeviceCapturePath").eq(0).text(re.$XML(t).find("DeviceCapturePath").eq(0).text()),re.$XML(g).find("PlaybackPicPath").eq(0).text(re.$XML(t).find("PlaybackPicPath").eq(0).text()),re.$XML(g).find("DownloadPath").eq(0).text(re.$XML(t).find("DownloadPath").eq(0).text()),re.$XML(g).find("IVSMode").eq(0).text(re.$XML(t).find("IVSMode").eq(0).text()),re.$XML(g).find("CaptureFileFormat").eq(0).text(re.$XML(t).find("CaptureFileFormat").eq(0).text()),y.HWP_SetLocalConfig(v.toXMLStr(g))?0:-1};var F=function(r,s,o,i,a,u,c){var e={protocol:s,success:null,error:null};v.extend(e,c),v.extend(e,{success:function(e){var t,n=new O;n.szIP=r,2==s?(n.szHttpProtocol="https://",n.iHttpsPort=o):(n.szHttpProtocol="http://",n.iHttpPort=o),n.iCGIPort=o,n.szDeviceIdentify=r+"_"+o,n.szAuth=i,n.iDeviceProtocol=a,n.oProtocolInc=u,T("使用%s协议登录成功",a),w(n),t=p.bWndFull?1:0,y.HWP_SetCanFullScreen(t),y.HWP_SetPackageType(p.iPackageType),G(n),I.push(jQuery.extend({},n)),c.success&&c.success(e)},error:function(e,t){c.error&&c.error(e,t)}}),u.login(r,o,i,e)};function U(e,t,n){return(e<<16|t<<8|n).toString(16)}function V(e,t){return(Array(t).join("0")+e).slice(-t)}function j(e){if(e&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(e)){if(4===e.length){for(var t="#",n=1;n<4;n+=1)t+=e.slice(n,n+1).concat(e.slice(n,n+1));e=t}var r=[];for(n=1;n<7;n+=2)r.push(parseInt("0x"+e.slice(n,n+2)));return"["+r.join(",")+",0.6]"}return e}function O(){if(void 0!==O.unique)return O.unique;this.szIP="",this.szHostName="",this.szAuth="",this.szHttpProtocol="http://",this.iCGIPort=80,this.szDeviceIdentify="",this.iDevicePort=-1,this.iHttpPort=-1,this.iHttpsPort=-1,this.iRtspPort=-1,this.iWSPort=-1,this.iAudioType=1,this.m_iAudioBitRate=-1,this.m_iAudioSamplingRate=-1,this.iDeviceProtocol=x,this.oProtocolInc=null,this.iAnalogChannelNum=0,this.szDeviceType="",this.bVoiceTalk=!1,this.oAuthType={},this.oStreamCapa={bObtained:!1,bSupportShttpPlay:!1,bSupportShttpPlayback:!1,bSupportShttpsPlay:!1,bSupportShttpsPlayback:!1,bSupportShttpPlaybackTransCode:!1,bSupportShttpsPlaybackTransCode:!1,iIpChanBase:1},O.unique=this}this.getAuthType=function(t,n,e,r,s,o){t.oAuthType[n]=1;var i={async:!0,success:function(e){t.oAuthType[n]=re.$XML(e).find("sessionIDVersion").eq(0).text(),o()},error:function(e){5003,0,6,23,0,6,27,3,3,611,1,3,62,5,2,81,0,5,59")?-1:0},this.I_SendHTTPRequest=function(e,t,n){var r=this.findDeviceIndexByIP(e);if(!(r<0)){var s=I[r],o=new K,i={type:"GET",url:s.szHttpProtocol+s.szIP+":"+s.iCGIPort+"/"+t,auth:s.szAuth,success:null,error:null};v.extend(i,n),v.extend(i,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),o.setRequestParam(i),o.submitRequest()}},this.I_RemoteConfig=function(e,t){var n=this.findDeviceIndexByIP(e),r=-1;if(Z())return-1;var s={iLan:0,iDevicePort:-1,iType:0};if(v.extend(s,t),-1==n)return-1;var o=I[n];if(-1==s.iDevicePort)if(-1==o.iDevicePort){if(o.iDevicePort=W(o).iDevicePort,-1==(r=o.iDevicePort))return-1}else r=o.iDevicePort;else r=s.iDevicePort;if(":"==v.Base64.decode(o.szAuth)[0])var i=v.Base64.decode(o.szAuth).split(":")[1],a=v.Base64.decode(o.szAuth).split(":")[2];else i=v.Base64.decode(o.szAuth).split(":")[0],a=v.Base64.decode(o.szAuth).split(":")[1];var u=""+s.iType+""+s.iLan+""+o.szIP+""+r+""+i+""+v.Base64.encode(a)+"";return y.HWP_ShowRemConfig(u)},this.I_ChangeWndNum=function(e){return isNaN(parseInt(e,10))?-1:(Z()?y.JS_ArrangeWindow(e):y.HWP_ArrangeWindow(e),0)},this.I_GetLastError=function(){return Z()?-1:y.HWP_GetLastError()},this.I_GetWindowStatus=function(e){if(M(e)){var t=[];return v.extend(t,m),t}var n=this.findWndIndexByIndex(e);if(-1==n)return null;t={};return v.extend(t,m[n]),t},this.I_GetIPInfoByMode=function(e,t,n,r){return Z()?"":y.HWP_GetIpInfoByMode(e,t,n,r)},this.I_SetPlayModeType=function(e){return Z()?0:y.HWP_SetPlayModeType(e)},this.I_SetSnapDrawMode=function(e,t){return Z()?-1',r=0;r";var s=j(t[r].szDrawColor);n+=""+t[r].szTips.split("#")[1]+"1"+s[0]+""+s[1]+""+s[2]+""+t[r].szTips+""+t[r].bClosed+"";for(var o=0;o"+t[r].aPoint[o][0]/h+""+t[r].aPoint[o][1]/f+"";n+=""}return n+=""}return y.HWP_GetSnapPolygonInfo(e)},this.I_ClearSnapInfo=function(e){return Z()?y.JS_ClearSnapInfo():y.HWP_ClearSnapInfo(e,1)},this.I_DeviceCapturePic=function(e,t,n,r){var s=this.findDeviceIndexByIP(e),o=-1;if(-1!=s){var i=I[s],a={bDateDir:!0};if(v.extend(a,r),!M(a.iResolutionWidth)&&!v.isInt(a.iResolutionWidth))return o;if(!M(a.iResolutionHeight)&&!v.isInt(a.iResolutionHeight))return o;o=i.oProtocolInc.deviceCapturePic(i,t,n,a)}return o},this.I_SetPackageType=function(e){return Z()?-1:y.HWP_SetPackageType(e)},this.I_GetDevicePort=function(e){var t=this.findDeviceIndexByIP(e),n=null;if(-1!=t){var r=I[t];n=W(r)}return n},this.I_GetTextOverlay=function(e,t,n){var r=this.findDeviceIndexByIP(t);if(-1!=r){var s=I[r],o=(m[r],{async:!1,type:"GET",success:n.success,error:n.error});this.I_SendHTTPRequest(s.szIP+"_"+s.iCGIPort,e,o)}return-1},this.findDeviceIndexByIP=function(e){if(-1"),t.push(""+v.escape(re.$XML(e).find("deviceName").eq(0).text())+""),t.push(""+re.$XML(e).find("deviceID").eq(0).text()+""),t.push(""+re.$XML(e).find("deviceType").eq(0).text()+""),t.push(""+re.$XML(e).find("model").eq(0).text()+""),t.push(""+re.$XML(e).find("serialNumber").eq(0).text()+""),t.push(""+re.$XML(e).find("macAddress").eq(0).text()+""),t.push(""+re.$XML(e).find("firmwareVersion").eq(0).text()+""),t.push(""+re.$XML(e).find("firmwareReleasedDate").eq(0).text()+""),t.push(""+re.$XML(e).find("encoderVersion").eq(0).text()+""),t.push(""+re.$XML(e).find("encoderReleasedDate").eq(0).text()+""),t.push(""),e=v.loadXML(t.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getAnalogChannelInfo=function(e,i){var aa = e;var t=b(this.CGI.getAnalogChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new K,r={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(r,i),v.extend(r,{success:function(e){var t=[];t.push("");aa.iAnalogChannelNum=re.$XML(e).find("VideoInputChannel",!0).length;for(var n=re.$XML(e).find("VideoInputChannel",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("id").eq(0).text()+""),t.push(""+re.$XML(o).find("inputPort").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("name").eq(0).text())+""),t.push(""+re.$XML(o).find("videoFormat").eq(0).text()+""),t.push("")}t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),n.setRequestParam(r),n.submitRequest()},e.prototype.getDigitalChannel=function(e,i){var t=b(this.CGI.getDigitalChannel,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new K,r={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(r,i),v.extend(r,{success:function(e){var t=[];t.push("");for(var n=re.$XML(e).find("InputProxyChannel",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("id").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("name").eq(0).text())+""),t.push("")}t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),n.setRequestParam(r),n.submitRequest()},e.prototype.getDigitalChannelInfo=function(e,a){var u=null,c={};if(this.getDigitalChannel(e,{async:!1,success:function(e){u=e;for(var t=re.$XML(u).find("InputProxyChannel",!0),n=0,r=t.length;n");for(var n=re.$XML(e).find("InputProxyChannelStatus",!0),r=0,s=n.length;r"),t.push(""+i+""),t.push(""),t.push(""+re.$XML(o).find("proxyProtocol").eq(0).text()+""),t.push(""+re.$XML(o).find("addressingFormatType").eq(0).text()+""),t.push(""+re.$XML(o).find("ipAddress").eq(0).text()+""),t.push(""+re.$XML(o).find("managePortNo").eq(0).text()+""),t.push(""+re.$XML(o).find("srcInputPort").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("userName").eq(0).text())+""),t.push(""+re.$XML(o).find("streamType").eq(0).text()+""),t.push(""+re.$XML(o).find("online").eq(0).text()+""),t.push(""+v.escape(c[i])+""),t.push(""),t.push("")}t.push(""),e=v.loadXML(t.join("")),a.success&&a.success(e)},error:function(e,t){a.error&&a.error(e,t)}}),n.setRequestParam(r),n.submitRequest()}},e.prototype.getZeroChannelInfo=function(e,n){var t=b(this.CGI.getZeroChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getStreamChannels=function(e,n){if(0!=e.iAnalogChannelNum)var t=b(this.CGI.getStreamChannels.analog,e.szHttpProtocol,e.szIP,e.iCGIPort);else t=b(this.CGI.getStreamChannels.digital,e.szHttpProtocol,e.szIP,e.iCGIPort);var r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getPPPoEStatus=function(e,n){var t=b(this.CGI.getPPPoEStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getUPnPPortStatus=function(e,n){var t=b(this.CGI.getUPnPPortStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getNetworkBond=function(e,n){var t=b(this.CGI.getNetworkBond,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getNetworkInterface=function(e,n){var t=b(this.CGI.getNetworkInterface,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getPortInfo=function(e,n){var t=b(this.CGI.getPortInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.startRealPlay=function(t,n){var e=100*n.iChannelID+n.iStreamType,r="",s=t.szIP;if("rtsp://"===n.urlProtocol&&(s=A(s)),r=n.bZeroChannel?(Z()&&(e=0),b(n.cgi.zeroChannels,n.urlProtocol,s,n.iPort,e)):b(n.cgi.channels,n.urlProtocol,s,n.iPort,e),p.proxyAddress&&Z()){v.cookie("webVideoCtrlProxy",s+":"+n.iPort,{raw:!0}),r=b(n.cgi.zeroChannels,n.urlProtocol,p.proxyAddress.ip,p.proxyAddress.wsport,e);var o=s+":"+n.iPort;-1"+i.iPTZSpeed+"";else{0===i.iPTZSpeed&&(e=!0);var n=99;e&&(n=96),a=b(this.CGI.ptzAutoControl.ipdome,s.szHttpProtocol,s.szIP,s.iCGIPort,o.iChannelID,n)}var r=new K,c={type:"PUT",url:a,async:!1,auth:s.szAuth,data:u,success:null,error:null},l=this;v.extend(c,i),v.extend(c,{success:function(e){o.bPTZAuto=!o.bPTZAuto,i.success&&i.success(e)},error:function(e,t){if(d==s.szDeviceType||z==s.szDeviceType){a=o.bShttpIPChannel?b(l.CGI.ptzControl.analog,s.szHttpProtocol,s.szIP,s.iCGIPort,o.iChannelID-s.oStreamCapa.iIpChanBase+1+s.iAnalogChannelNum):b(l.CGI.ptzControl.analog,s.szHttpProtocol,s.szIP,s.iCGIPort,o.iChannelID),u=""+i.iPTZSpeed+"0";var n=new K,r={type:"PUT",url:a,async:!1,auth:s.szAuth,data:u,success:null,error:null};v.extend(r,i),n.setRequestParam(r),n.submitRequest()}else i.error&&i.error(e,t)}}),r.setRequestParam(c),r.submitRequest()},e.prototype.ptzControl=function(e,t,n,r){var s=n.iChannelID,o="";n.bPTZAuto&&this.ptzAutoControl(e,!0,n,{iPTZSpeed:0}),r.iPTZSpeed=t?0:r.iPTZSpeed<7?15*r.iPTZSpeed:100;var i=[{},{pan:0,tilt:r.iPTZSpeed},{pan:0,tilt:-r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:0},{pan:r.iPTZSpeed,tilt:0},{pan:-r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:-r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:-r.iPTZSpeed},{},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed}],a="",u={};switch(r.iPTZIndex){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:u=this.CGI.ptzControl,a=""+i[r.iPTZIndex].pan+""+i[r.iPTZIndex].tilt+"";break;case 10:case 11:u=this.CGI.ptzControl,a=""+i[r.iPTZIndex].speed+"";break;case 12:case 13:u=this.CGI.ptzFocus,a=""+i[r.iPTZIndex].speed+"";break;case 14:case 15:u=this.CGI.ptzIris,a=""+i[r.iPTZIndex].speed+"";break;default:return void(r.error&&r.error())}o=u!=this.CGI.ptzFocus&&u!=this.CGI.ptzIris||e.szDeviceType!=d&&e.szDeviceType!=D&&e.szDeviceType!=z?s<=e.iAnalogChannelNum?b(u.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):n.bShttpIPChannel?b(u.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):b(u.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):b(u.ipc,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID);var c=new K,l={type:"PUT",url:o,async:!1,auth:e.szAuth,data:a,success:null,error:null};v.extend(l,r),v.extend(l,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),c.setRequestParam(l),c.submitRequest()},e.prototype.setPreset=function(e,t,n){var r="",s="";r=t.iChannelID<=e.iAnalogChannelNum?b(this.CGI.setPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?b(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):b(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),s="",s+="",s+=""+n.iPresetID+"",e.szDeviceType!=D&&(s+="Preset"+n.iPresetID+""),s+="";var o=new K,i={type:"PUT",url:r,auth:e.szAuth,data:s,success:null,error:null};v.extend(i,n),v.extend(i,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),o.setRequestParam(i),o.submitRequest()},e.prototype.goPreset=function(e,t,n){var r="";r=t.iChannelID<=e.iAnalogChannelNum?b(this.CGI.goPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?b(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):b(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID);var s=new K,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};v.extend(o,n),v.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},e.prototype.overlayInfo=function(){return szUrl=this.CGI.overlayInfo.analog,szUrl},e.prototype.recordSearch=function(e,i){var t,n,r=i.iChannelID,s=i.iStreamType,o=i.szStartTime.replace(" ","T")+"Z",a=i.szEndTime.replace(" ","T")+"Z";t=b(this.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),n=""+new te+""+(100*r+s)+""+o+""+a+"40"+i.iSearchPos+"//metadata.ISAPI.org/VideoMotion";var u=new K,c={type:"POST",url:t,auth:e.szAuth,data:n,success:null,error:null};v.extend(c,i),v.extend(c,{success:function(e){var t=[];t.push(""),t.push(""+re.$XML(e).find("responseStatus").eq(0).text()+""),t.push(""+re.$XML(e).find("responseStatusStrg").eq(0).text()+""),t.push(""+re.$XML(e).find("numOfMatches").eq(0).text()+""),t.push("");for(var n=re.$XML(e).find("searchMatchItem",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("trackID").eq(0).text()+""),t.push(""+re.$XML(o).find("startTime").eq(0).text()+""),t.push(""+re.$XML(o).find("endTime").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("playbackURI").eq(0).text())+""),t.push(""+re.$XML(o).find("metadataDescriptor").eq(0).text().split("/")[1]+""),t.push("")}t.push(""),t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),u.setRequestParam(c),u.submitRequest()},e.prototype.startPlayback=function(t,n){var r=n.iWndIndex,e="",s=n.szStartTime,o=n.szEndTime,i=t.szIP;if("rtsp://"===n.urlProtocol&&(i=A(i)),Z())if(p.proxyAddress){v.cookie("webVideoCtrlProxy",i+":"+n.iPort,{raw:!0}),e=b(n.cgi,n.urlProtocol,p.proxyAddress.ip,p.proxyAddress.wsport,n.iChannelID);var a=i+":"+n.iPort;-1"),n.push(""),n.push(""+t.TransFrameRate+""),n.push(""+t.TransResolution+""),n.push(""+t.TransBitrate+""),n.push(""),n.join("")}(n.oTransCodeParam);if(""==u)return-1;y.HWP_SetTrsPlayBackParam(r,u)}var c=function(){var e=new J;e.iIndex=r,e.szIP=t.szIP,e.iCGIPort=t.iCGIPort,e.szDeviceIdentify=t.szDeviceIdentify,e.iChannelID=n.iChannelID,e.iPlayStatus=2,m.push(e)},l=$.Deferred();if(Z()){var d={};d=t.oAuthType[i]<2?{sessionID:t.szAuth}:{token:L(0,t.szDeviceIdentify)},y.JS_Play(e,d,r,s,o).then(function(){c(),l.resolve()},function(){l.reject()})}else{0==y.HWP_Play(e,t.szAuth,r,s,o)?(c(),l.resolve()):l.reject()}return l},e.prototype.reversePlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,o=e.szIP;"rtsp://"===t.urlProtocol&&(o=A(o));var i=b(t.cgi,t.urlProtocol,o,t.iPort,t.iChannelID,r,s),a=y.HWP_ReversePlay(i,e.szAuth,n,r,s);if(0==a){var u=new J;u.iIndex=n,u.szIP=e.szIP,u.iCGIPort=e.iCGIPort,u.szDeviceIdentify=e.szDeviceIdentify,u.iChannelID=t.iChannelID,u.iPlayStatus=5,m.push(u)}return a},e.prototype.startDownloadRecord=function(e,t){var n=b(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),r=" "+v.escape(t.szPlaybackURI)+"";return Z()?(n=B(n),y.JS_StartDownload(n,e.szAuth,t.szFileName,r)):y.HWP_StartDownload(n,e.szAuth,t.szFileName,r,t.bDateDir)},e.prototype.exportDeviceConfig=function(e,t){var n=b(this.CGI.downloaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);if(Z()){var r={type:"PUT",url:n,auth:e.szAuth,success:function(){},error:function(){}},s=new K;return s.setRequestParam(r),s.submitRequest(),n=B(n),t&&(n=v.exportPasswordDeviceConfig(n,t)),y.JS_ExportDeviceConfig(n)}return t&&(n=v.exportPasswordDeviceConfig(n,t)),y.HWP_ExportDeviceConfig(n,e.szAuth,"",0)},e.prototype.importDeviceConfig=function(e,t,n){var r=b(this.CGI.uploaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);if(Z()){var s={type:"PUT",url:r,auth:e.szAuth,success:function(){},error:function(){}},o=new K;return o.setRequestParam(s),o.submitRequest(),r=B(r),n&&(r=v.exportPasswordDeviceConfig(r,n)),y.JS_UploadFile(r)}return n&&(r=v.exportPasswordDeviceConfig(r,n)),y.HWP_ImportDeviceConfig(r,e.szAuth,t.szFileName,0)},e.prototype.restart=function(e,n){var t=b(this.CGI.restart,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"PUT",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.restore=function(e,t,n){var r=b(this.CGI.restore,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=new K,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};v.extend(o,n),v.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},e.prototype.startUpgrade=function(e,t){$.Deferred();var n=b(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),r=b(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);return szRet=y.HWP_StartUpgrade(n,r,e.szAuth,t.szFileName)},e.prototype.asyncstartUpgrade=function(e,t){var n=$.Deferred(),r=b(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),s=b(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);if(Z())r=B(r),s=B(s),y.JS_StartUpgradeEx(r,s).then(function(e){n.resolve(e)},function(){n.reject(o)});else{var o=y.HWP_StartUpgrade(r,s,e.szAuth,t.szFileName);0===o?n.resolve(o):n.reject(o)}return n},e.prototype.set3DZoom=function(e,t,n,r){var s="";if(s=t.iChannelID<=e.iAnalogChannelNum?b(this.CGI.set3DZoom.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID):t.bShttpIPChannel?b(this.CGI.set3DZoom.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):b(this.CGI.set3DZoom.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID),Z())var o=v.loadXML(n),i=parseInt(n.startPos[0]/h*255,10),a=parseInt(n.startPos[1]/f*255,10),u=parseInt(n.endPos[0]/h*255,10),c=parseInt(n.endPos[1]/f*255,10);else o=v.loadXML(n),i=parseInt(re.$XML(o).find("StartPoint").eq(0).find("positionX").eq(0).text(),10),a=parseInt(re.$XML(o).find("StartPoint").eq(0).find("positionY").eq(0).text(),10),u=parseInt(re.$XML(o).find("EndPoint").eq(0).find("positionX").eq(0).text(),10),c=parseInt(re.$XML(o).find("EndPoint").eq(0).find("positionY").eq(0).text(),10);var l=""+i+""+(255-a)+""+u+""+(255-c)+"",d=new K,p={type:"PUT",url:s,data:l,auth:e.szAuth,success:null,error:null};v.extend(p,r),v.extend(p,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),d.setRequestParam(p),d.submitRequest()},e.prototype.getSDKCapa=function(e,n){var t=b(this.CGI.SDKCapabilities,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,async:!1,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.deviceCapturePic=function(e,t,n,r){t=100*t+1;var s,o,i=-1,a=b(this.CGI.deviceCapture.channels,e.szHttpProtocol,e.szIP,e.iCGIPort,t),u=[];if(v.isInt(r.iResolutionWidth)&&u.push("videoResolutionWidth="+r.iResolutionWidth),v.isInt(r.iResolutionHeight)&&u.push("videoResolutionHeight="+r.iResolutionHeight),0
  • '),$("#jsplugin_download_li").trigger("click"),$("#jsplugin_download_a").remove(),i=0}else i=y.HWP_DeviceCapturePic(a,e.szAuth,n,r.bDateDir);return i},e.prototype.getSessionV2Cap=function(e,t,n,r,s,o){var i="";i=2==n?"https://":"http://";var a=b(this.CGI.sessionCap,i,t,r,encodeURIComponent(s));a=a+"&random:"+e;var u=new K,c={type:"GET",url:a,auth:"",success:null,error:null};v.extend(c,o),v.extend(c,{success:function(e){o.success&&o.success(e)},error:function(e,t){o.error&&o.error(e,t)}}),u.setRequestParam(c),u.submitRequest()},e.prototype.getSessionCap=function(e,t,n,r,s){var o="";o=2==t?"https://":"http://";var i=b(this.CGI.sessionCap,o,e,n,encodeURIComponent(r)),a=new K,u={type:"GET",url:i,auth:"",success:null,error:null};v.extend(u,s),v.extend(u,{success:function(e){s.success&&s.success(e)},error:function(e,t){s.error&&s.error(e,t)}}),a.setRequestParam(u),a.submitRequest()},e.prototype.sessionV2Login=function(e,t,n,r,s,o,i,a){var u="";u=2==n?"https://":"http://";var c=parseInt(re.$XML(i).find("sessionIDVersion").eq(0).text(),10),l="true"===re.$XML(i).find("isSessionIDValidLongTerm").eq(0).text(),d=b(this.CGI.sessionLogin,u,t,r),p=re.$XML(i).find("sessionID").eq(0).text(),h=re.$XML(i).find("challenge").eq(0).text(),f=parseInt(re.$XML(i).find("iterations").eq(0).text(),10),P=!1,I="";0";S+=""+v.escape(s)+"",S+=""+m+"",S+=""+p+"",S+=""+l+"",S+=""+c+"",S+="";var C=new K,y={type:"POST",url:d,data:S,auth:"",success:null,error:null};v.extend(y,a),v.extend(y,{success:function(e){a.success&&a.success(e)},error:function(e,t){a.error&&a.error(e,t)}}),C.setRequestParam(y),C.submitRequest()},e.prototype.sessionLogin=function(e,t,n,r,s,o,i){var a="";a=2==t?"https://":"http://";var u=b(this.CGI.sessionLogin,a,e,n),c=re.$XML(o).find("sessionID").eq(0).text(),l=re.$XML(o).find("challenge").eq(0).text(),d=parseInt(re.$XML(o).find("iterations").eq(0).text(),10),p=!1,h="";0",I+=""+f+"",I+=""+c+"",I+="";var m=new K,S={type:"POST",url:u,data:I,auth:"",success:null,error:null};v.extend(S,i),v.extend(S,{success:function(e){i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),m.setRequestParam(S),m.submitRequest()},e.prototype.sessionHeartbeat=function(e,t,n){var r=b(this.CGI.sessionHeartbeat,e.szHttpProtocol,e.szIP,e.iCGIPort),s=new K,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};v.extend(o,{success:function(e){t&&t(e)},error:function(e,t){n&&n(e,t)}}),s.setRequestParam(o),s.submitRequest()},e.prototype.sessionLogout=function(e,n){var t=b(this.CGI.sessionLogout,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"PUT",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},e.prototype.getSystemCapa=function(e,n){var t=b(this.CGI.systemCapabilities,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,async:!1,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()};var n=function(){};n.prototype.CGI={login:"%s%s:%s/PSIA/Custom/SelfExt/userCheck",getAudioInfo:"%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels",getDeviceInfo:"%s%s:%s/PSIA/System/deviceInfo",getAnalogChannelInfo:"%s%s:%s/PSIA/System/Video/inputs/channels",getDigitalChannel:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels",getDigitalChannelInfo:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynVideo/inputs/channels/status",getZeroChannelInfo:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroVideo/channels",getStreamChannels:{analog:"%s%s:%s/PSIA/Streaming/channels",digital:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels"},getStreamDynChannels:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/DynStreaming/channels",startRealPlay:{channels:"%s%s:%s/PSIA/streaming/channels/%s",zeroChannels:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/ZeroStreaming/channels/%s"},startVoiceTalk:{open:"%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/open",close:"%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/close",audioData:"%s%s:%s/PSIA/Custom/SelfExt/TwoWayAudio/channels/%s/audioData"},ptzControl:"%s%s:%s/PSIA/PTZ/channels/%s/continuous",ptzAutoControl:"%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/autoptz",setPreset:"%s%s:%s/PSIA/PTZ/channels/%s/presets/%s",goPreset:"%s%s:%s/PSIA/PTZ/channels/%s/presets/%s/goto",ptzFocus:"%s%s:%s/PSIA/System/Video/inputs/channels/%s/focus",ptzIris:"%s%s:%s/PSIA/System/Video/inputs/channels/%s/iris",getNetworkBond:"%s%s:%s/PSIA/Custom/SelfExt/Bond",getNetworkInterface:"%s%s:%s/PSIA/System/Network/interfaces",getUPnPPortStatus:"%s%s:%s/PSIA/Custom/SelfExt/UPnP/ports/status",getPPPoEStatus:"%s%s:%s/PSIA/Custom/SelfExt/PPPoE/1/status",getPortInfo:"%s%s:%s/PSIA/Security/AAA/adminAccesses",recordSearch:"%s%s:%s/PSIA/ContentMgmt/search",startPlayback:"%s%s:%s/PSIA/streaming/tracks/%s?starttime=%s&endtime=%s",startDownloadRecord:"%s%s:%s/PSIA/Custom/SelfExt/ContentMgmt/download",deviceConfig:"%s%s:%s/PSIA/System/configurationData",restart:"%s%s:%s/PSIA/System/reboot",restore:"%s%s:%s/PSIA/System/factoryReset?mode=%s",startUpgrade:{upgrade:"%s%s:%s/PSIA/System/updateFirmware",status:"%s%s:%s/PSIA/Custom/SelfExt/upgradeStatus"},set3DZoom:"%s%s:%s/PSIA/Custom/SelfExt/PTZ/channels/%s/Set3DZoom",deviceCapture:{channels:"%s%s:%s/PSIA/Streaming/channels/%s/picture"},systemCapabilities:"%s%s:%s/PSIA/System/capabilities"},n.prototype.login=function(e,t,n,r){var s=2==r.protocol?"https://":"http://",o=b(this.CGI.login,s,e,t),i=new K,a={type:"GET",url:o,auth:n,success:null,error:null};v.extend(a,r),v.extend(a,{success:function(e){"200"==re.$XML(e).find("statusValue").eq(0).text()?r.success&&r.success(e):r.error&&r.error(401,e)},error:function(e,t){r.error&&r.error(e,t)}}),i.setRequestParam(a),i.submitRequest()},n.prototype.getAudioInfo=function(e,n){var t=b(this.CGI.getAudioInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getDeviceInfo=function(e,n){var t=b(this.CGI.getDeviceInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){var t=[];t.push(""),t.push(""+v.escape(re.$XML(e).find("deviceName").eq(0).text())+""),t.push(""+re.$XML(e).find("deviceID").eq(0).text()+""),t.push(""+re.$XML(e).find("deviceDescription").eq(0).text()+""),t.push(""+re.$XML(e).find("model").eq(0).text()+""),t.push(""+re.$XML(e).find("serialNumber").eq(0).text()+""),t.push(""+re.$XML(e).find("macAddress").eq(0).text()+""),t.push(""+re.$XML(e).find("firmwareVersion").eq(0).text()+""),t.push(""+re.$XML(e).find("firmwareReleasedDate").eq(0).text()+""),t.push(""+re.$XML(e).find("logicVersion").eq(0).text()+""),t.push(""+re.$XML(e).find("logicReleasedDate").eq(0).text()+""),t.push(""),e=v.loadXML(t.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getSystemCapa=function(e,n){var t=b(this.CGI.systemCapabilities,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",async:!1,url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getAnalogChannelInfo=function(e,i){var t=b(this.CGI.getAnalogChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new K,r={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(r,i),v.extend(r,{success:function(e){var t=[];t.push("");e.iAnalogChannelNum=re.$XML(e).find("VideoInputChannel",!0).length;for(var n=re.$XML(e).find("VideoInputChannel",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("id").eq(0).text()+""),t.push(""+re.$XML(o).find("inputPort").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("name").eq(0).text())+""),t.push(""+re.$XML(o).find("videoFormat").eq(0).text()+""),t.push("")}t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),n.setRequestParam(r),n.submitRequest()},n.prototype.getDigitalChannel=function(e,i){var t=b(this.CGI.getDigitalChannel,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new K,r={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(r,i),v.extend(r,{success:function(e){var t=[];t.push("");for(var n=re.$XML(e).find("DynVideoInputChannel",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("id").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("name").eq(0).text())+""),t.push("")}t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),n.setRequestParam(r),n.submitRequest()},n.prototype.getDigitalChannelInfo=function(e,a){var u=null,c={};if(this.getDigitalChannel(e,{async:!1,success:function(e){u=e;for(var t=re.$XML(u).find("InputProxyChannel",!0),n=0,r=t.length;n");for(var n=re.$XML(e).find("DynVideoInputChannelStatus",!0),r=0,s=n.length;r"),t.push(""+i+""),t.push(""),t.push(""+re.$XML(o).find("adminProtocol").eq(0).text()+""),t.push(""+re.$XML(o).find("addressingFormatType").eq(0).text()+""),t.push(""+re.$XML(o).find("ipAddress").eq(0).text()+""),t.push(""+re.$XML(o).find("adminPortNo").eq(0).text()+""),t.push(""+re.$XML(o).find("srcInputPort").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("userName").eq(0).text())+""),t.push(""+re.$XML(o).find("streamType").eq(0).text()+""),t.push(""+re.$XML(o).find("online").eq(0).text()+""),t.push(""+v.escape(c[i])+""),t.push(""),t.push("")}t.push(""),e=v.loadXML(t.join("")),a.success&&a.success(e)},error:function(e,t){a.error&&a.error(e,t)}}),n.setRequestParam(r),n.submitRequest()}},n.prototype.getZeroChannelInfo=function(e,n){var t=b(this.CGI.getZeroChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getPPPoEStatus=function(e,n){var t=b(this.CGI.getPPPoEStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getUPnPPortStatus=function(e,n){var t=b(this.CGI.getUPnPPortStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getNetworkBond=function(e,n){var t=b(this.CGI.getNetworkBond,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getNetworkInterface=function(e,n){var t=b(this.CGI.getNetworkInterface,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getPortInfo=function(o,i){var e=b(this.CGI.getPortInfo,o.szHttpProtocol,o.szIP,o.iCGIPort),t=new K,n={type:"GET",url:e,auth:o.szAuth,success:null,error:null};v.extend(n,i),v.extend(n,{success:function(e){var r=[];r.push("");for(var t=re.$XML(e).find("AdminAccessProtocol",!0),n=0,s=t.length;n"),r.push(""+re.$XML(e).find("id").eq(0).text()+""),r.push(""+re.$XML(e).find("enabled").eq(0).text()+""),r.push(""+re.$XML(e).find("protocol").eq(0).text().toUpperCase()+""),r.push(""+re.$XML(e).find("portNo").eq(0).text()+""),r.push("")}C.getStreamChannels(o,{async:!1,success:function(e){if(0"),r.push("4"),r.push("true"),r.push("RTSP"),r.push(""+t+""),r.push(""),r.push("");var n=v.loadXML(r.join(""));i.success&&i.success(n)}else C.getStreamDynChannels(o,{async:!1,success:function(e){if(0"),r.push("4"),r.push("true"),r.push("RTSP"),r.push(""+t+""),r.push(""),r.push("");var n=v.loadXML(r.join(""));i.success&&i.success(n)}},error:function(){i.error&&i.error()}})},error:function(){i.error&&i.error()}})},error:function(){var r=[];r.push(""),C.getStreamChannels(o,{async:!1,success:function(e){if(0"),r.push("4"),r.push("true"),r.push("RTSP"),r.push(""+t+""),r.push(""),r.push("");var n=v.loadXML(r.join(""));i.success&&i.success(n)}else C.getStreamDynChannels(o,{async:!1,success:function(e){if(0"),r.push("4"),r.push("true"),r.push("RTSP"),r.push(""+t+""),r.push(""),r.push("");var n=v.loadXML(r.join(""));i.success&&i.success(n)}},error:function(){i.error&&i.error()}})},error:function(){i.error&&i.error()}})}}),t.setRequestParam(n),t.submitRequest()},n.prototype.getStreamChannels=function(e,n){if(0!=e.iAnalogChannelNum)var t=b(this.CGI.getStreamChannels.analog,e.szHttpProtocol,e.szIP,e.iCGIPort);else t=b(this.CGI.getStreamChannels.digital,e.szHttpProtocol,e.szIP,e.iCGIPort);var r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.getStreamDynChannels=function(e,n){var t=b(this.CGI.getStreamDynChannels,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"GET",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.startRealPlay=function(e,t){var n=100*t.iChannelID+t.iStreamType,r="",s=e.szIP;"rtsp://"===t.urlProtocol&&(s=A(s)),r=t.bZeroChannel?b(t.cgi.zeroChannels,t.urlProtocol,s,t.iPort,n):b(t.cgi.channels,t.urlProtocol,s,t.iPort,n);var o=y.HWP_Play(r,e.szAuth,t.iWndIndex,"","");if(0==o){var i=new J;i.iIndex=t.iWndIndex,i.szIP=e.szIP,i.iCGIPort=e.iCGIPort,i.szDeviceIdentify=e.szDeviceIdentify,i.iChannelID=t.iChannelID,i.iPlayStatus=1,m.push(i)}return o},n.prototype.startVoiceTalk=function(e,t){var n=b(this.CGI.startVoiceTalk.open,e.szHttpProtocol,e.szIP,e.iCGIPort,t),r=b(this.CGI.startVoiceTalk.close,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=b(this.CGI.startVoiceTalk.audioData,e.szHttpProtocol,e.szIP,e.iCGIPort,t);return y.HWP_StartVoiceTalkEx(n,r,s,e.szAuth,e.iAudioTypeoDeviceInfo.m_iAudioBitRate,e.m_iAudioSamplingRate)},n.prototype.ptzAutoControl=function(s,e,o,i){var t=o.iChannelID,a="",u="";if(i.iPTZSpeed=i.iPTZSpeed<7?15*i.iPTZSpeed:100,e&&(i.iPTZSpeed=0),s.szDeviceType!=D)a=b(this.CGI.ptzAutoControl,s.szHttpProtocol,s.szIP,s.iCGIPort,t),u=""+i.iPTZSpeed+"0";else{var n=99;e&&(n=96),a=b(this.CGI.goPreset,s.szHttpProtocol,s.szIP,s.iCGIPort,t,n)}var r=new K,c={type:"PUT",url:a,async:!1,auth:s.szAuth,data:u,success:null,error:null},l=this;v.extend(c,i),v.extend(c,{success:function(e){o.bPTZAuto=!o.bPTZAuto,i.success&&i.success(e)},error:function(e,t){if(s.szDeviceType!=D){a=b(l.CGI.ptzControl,s.szHttpProtocol,s.szIP,s.iCGIPort,o.iChannelID);var n=new K,r={type:"PUT",url:a,async:!1,auth:s.szAuth,data:u,success:null,error:null};v.extend(r,i),n.setRequestParam(r),n.submitRequest()}else i.error&&i.error(e,t)}}),r.setRequestParam(c),r.submitRequest()},n.prototype.ptzControl=function(e,t,n,r){var s;n.iChannelID;n.bPTZAuto&&this.ptzAutoControl(e,!0,n,{iPTZSpeed:0}),r.iPTZSpeed=t?0:r.iPTZSpeed<7?15*r.iPTZSpeed:100;var o=[{},{pan:0,tilt:r.iPTZSpeed},{pan:0,tilt:-r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:0},{pan:r.iPTZSpeed,tilt:0},{pan:-r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:-r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:-r.iPTZSpeed},{},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed}],i="",a={};switch(r.iPTZIndex){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:a=this.CGI.ptzControl,i=""+o[r.iPTZIndex].pan+""+o[r.iPTZIndex].tilt+"";break;case 10:case 11:a=this.CGI.ptzControl,i=""+o[r.iPTZIndex].speed+"";break;case 12:case 13:a=this.CGI.ptzFocus,i=""+o[r.iPTZIndex].speed+"";break;case 14:case 15:a=this.CGI.ptzIris,i=""+o[r.iPTZIndex].speed+"";break;default:return void(r.error&&r.error())}s=b(a,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID);var u=new K,c={type:"PUT",url:s,async:!1,auth:e.szAuth,data:i,success:null,error:null};v.extend(c,r),v.extend(c,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),u.setRequestParam(c),u.submitRequest()},n.prototype.setPreset=function(e,t,n){t.iChannelID;var r,s="";r=b(this.CGI.setPreset,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),s="",s+="",s+=""+n.iPresetID+"",e.szDeviceType!=D&&(s+="Preset"+n.iPresetID+""),s+="";var o=new K,i={type:"PUT",url:r,auth:e.szAuth,data:s,success:null,error:null};v.extend(i,n),v.extend(i,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),o.setRequestParam(i),o.submitRequest()},n.prototype.goPreset=function(e,t,n){var r;t.iChannelID;r=b(this.CGI.goPreset,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID);var s=new K,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};v.extend(o,n),v.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},n.prototype.recordSearch=function(e,i){var t,n,r=i.iChannelID,s=i.iStreamType,o=i.szStartTime.replace(" ","T")+"Z",a=i.szEndTime.replace(" ","T")+"Z";t=b(this.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),n=""+new te+""+(100*r+s)+""+o+""+a+"40"+i.iSearchPos+"//metadata.psia.org/VideoMotion";var u=new K,c={type:"POST",url:t,auth:e.szAuth,data:n,success:null,error:null};v.extend(c,i),v.extend(c,{success:function(e){var t=[];t.push(""),t.push(""+re.$XML(e).find("responseStatus").eq(0).text()+""),t.push(""+re.$XML(e).find("responseStatusStrg").eq(0).text()+""),t.push(""+re.$XML(e).find("numOfMatches").eq(0).text()+""),t.push("");for(var n=re.$XML(e).find("searchMatchItem",!0),r=0,s=n.length;r"),t.push(""+re.$XML(o).find("trackID").eq(0).text()+""),t.push(""+re.$XML(o).find("startTime").eq(0).text()+""),t.push(""+re.$XML(o).find("endTime").eq(0).text()+""),t.push(""+v.escape(re.$XML(o).find("playbackURI").eq(0).text())+""),t.push(""+re.$XML(o).find("metadataDescriptor").eq(0).text().split("/")[1]+""),t.push("")}t.push(""),t.push(""),e=v.loadXML(t.join("")),i.success&&i.success(e)},error:function(e,t){i.error&&i.error(e,t)}}),u.setRequestParam(c),u.submitRequest()},n.prototype.startPlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,o=e.szIP;"rtsp://"===t.urlProtocol&&(o=A(o));var i=b(t.cgi,t.urlProtocol,o,t.iPort,t.iChannelID,r,s),a=y.HWP_Play(i,e.szAuth,n,r,s);if(0==a){var u=new J;u.iIndex=n,u.szIP=e.szIP,u.iCGIPort=e.iCGIPort,u.szDeviceIdentify=e.szDeviceIdentify,u.iChannelID=t.iChannelID,u.iPlayStatus=2,m.push(u)}return a},n.prototype.reversePlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,o=e.szIP;"rtsp://"===t.urlProtocol&&(o=A(o));var i=b(t.cgi,t.urlProtocol,o,t.iPort,t.iChannelID,r,s),a=y.HWP_ReversePlay(i,e.szAuth,n,r,s);if(0==a){var u=new J;u.iIndex=n,u.szIP=e.szIP,u.iCGIPort=e.iCGIPort,u.szDeviceIdentify=e.szDeviceIdentify,u.iChannelID=t.iChannelID,u.iPlayStatus=5,m.push(u)}return a},n.prototype.startDownloadRecord=function(e,t){var n=b(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),r=" "+v.escape(t.szPlaybackURI)+"";return y.HWP_StartDownload(n,e.szAuth,t.szFileName,r,t.bDateDir)},n.prototype.exportDeviceConfig=function(e){var t=b(this.CGI.downloaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return Z()?-1:y.HWP_ExportDeviceConfig(t,e.szAuth,"",0)},n.prototype.importDeviceConfig=function(e,t){var n=b(this.CGI.uploaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return y.HWP_ImportDeviceConfig(n,e.szAuth,t.szFileName,0)},n.prototype.restart=function(e,n){var t=b(this.CGI.restart,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new K,s={type:"PUT",url:t,auth:e.szAuth,success:null,error:null};v.extend(s,n),v.extend(s,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),r.setRequestParam(s),r.submitRequest()},n.prototype.restore=function(e,t,n){var r=b(this.CGI.restore,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=new K,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};v.extend(o,n),v.extend(o,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),s.setRequestParam(o),s.submitRequest()},n.prototype.startUpgrade=function(e,t){var n=b(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),r=b(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);return y.HWP_StartUpgrade(n,r,e.szAuth,t.szFileName)},n.prototype.set3DZoom=function(e,t,n,r){var s=b(this.CGI.set3DZoom,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID),o=new K,i={type:"PUT",url:s,data:n,auth:e.szAuth,success:null,error:null};v.extend(i,r),v.extend(i,{success:function(e){r.success&&r.success(e)},error:function(e,t){r.error&&r.error(e,t)}}),o.setRequestParam(i),o.submitRequest()},n.prototype.deviceCapturePic=function(e,t,n,r){t=100*t+1;var s=b(this.CGI.deviceCapture.channels,e.szHttpProtocol,e.szIP,e.iCGIPort,t),o=[];return v.isInt(r.iResolutionWidth)&&o.push("videoResolutionWidth="+r.iResolutionWidth),v.isInt(r.iResolutionHeight)&&o.push("videoResolutionHeight="+r.iResolutionHeight),0"+n),n},ee.prototype.escape=function(e){return e?e.replace(/&/g,"&").replace(//g,">"):e},ee.prototype.encodePwd=function(e,t,n){var r="";if(n){r=v.sha256(t.userName+t.salt+e),r=v.sha256(r+t.challenge);for(s=2;s>2,o=(3&t)<<4|(n=e.charCodeAt(c++))>>4,i=(15&n)<<2|(r=e.charCodeAt(c++))>>6,a=63&r,isNaN(n)?i=a=64:isNaN(r)&&(a=64),u=u+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(i)+this._keyStr.charAt(a);return u},decode:function(e){var t,n,r,s,o,i,a="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,n=(15&s)<<4|(o=this._keyStr.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(i=this._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!=o&&(a+=String.fromCharCode(n)),64!=i&&(a+=String.fromCharCode(r));return a=ee.prototype.Base64._utf8_decode(a)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n>6|192):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128)),t+=String.fromCharCode(63&r|128))}return t},_utf8_decode:function(e){for(var t="",n=0,r=c1=c2=0;n/g,">"):""},ee.prototype.getIrreversibleKey=function(e,t){var n=e;if(oSecurityCap.oIrreversibleEncrypt.bSupport){var r=oSecurityCap.oIrreversibleEncrypt.salt;return v.sha256(t+r+e)}return n},ee.prototype.strToAESKey=function(e,t){var n="";if(0>16)+(t>>16)+(n>>16)<<16|65535&n}function S(e,t){return e>>>t|e<<32-t}return function(e){for(var t="",n=0;n<4*e.length;n++)t+="0123456789abcdef".charAt(e[n>>2]>>8*(3-n%4)+4&15)+"0123456789abcdef".charAt(e[n>>2]>>8*(3-n%4)&15);return t}(function(e,t){var n,r,s,o,i,a,u,c,l,d,p,h,f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],P=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],I=Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,l=0;l>>10,I[d-7]),S(I[d-15],7)^S(I[d-15],18)^I[d-15]>>>3),I[d-16]),p=m(m(m(m(c,S(i,6)^S(i,11)^S(i,25)),i&a^~i&u),f[d]),I[d]),h=m(S(n,2)^S(n,13)^S(n,22),n&r^n&s^r&s),c=u,u=a,a=i,i=m(o,p),o=s,s=r,r=n,n=m(p,h);P[0]=m(n,P[0]),P[1]=m(r,P[1]),P[2]=m(s,P[2]),P[3]=m(o,P[3]),P[4]=m(i,P[4]),P[5]=m(a,P[5]),P[6]=m(u,P[6]),P[7]=m(c,P[7])}return P}(function(e){for(var t=[],n=0;n<8*e.length;n+=8)t[n>>5]|=(255&e.charCodeAt(n/8))<<24-n%32;return t}(e=function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n>6|192):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128)),t+=String.fromCharCode(63&r|128))}return t}(e)),8*e.length))},ee.prototype.cookie=function(e,t,n){if(1