You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
111 KiB
JavaScript

3 months ago
!function(){if(!window.WebVideoCtrl){var e=function(){function e(e,t,n){return(e<<16|t<<8|n).toString(16)}function n(e,t){return(Array(t).join("0")+e).slice(-t)}function r(e){var t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(e&&t.test(e)){if(4===e.length){for(var n="#",r=1;4>r;r+=1)n+=e.slice(r,r+1).concat(e.slice(r,r+1));e=n}for(var s=[],r=1;7>r;r+=2)s.push(parseInt("0x"+e.slice(r,r+2)));return"["+s.join(",")+",0.6]"}return e}function s(){return void 0!==s.unique?s.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},s.unique=this,void 0)}function o(){this.id=this.createUUID()}var a="100%",u="100%",c="",l="";oSecurityCap={},szAESKey="";var d={szversion:"websdk3.220200429",szContainerID:"",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},p=null,f=0,h=!1,P=[],I=[],m=null,v=null,C=null,S=null,y=this,g=null;this.w_options=d,this.w_deviceSet=P,this.w_wndSet=I,this.w_xmlLocalCfg=g;var x=1,D=2,z=200,b=0,T=1,A=2,M=3,L=4,q=5,R=6,w=0,G=2,W=3,X=21,_=-1,H=0,k="IPCamera",E="IPDome",Z="IPZoom",B="<?xml version='1.0' encoding='utf-8'?><FileVersion><Platform name='win32'><npWebVideoKitPlugin.dll>3,0,6,2</npWebVideoKitPlugin.dll><WebVideoKitActiveX.ocx>3,0,6,2</WebVideoKitActiveX.ocx><PlayCtrl.dll>7,3,3,61</PlayCtrl.dll><StreamTransClient.dll>1,1,3,6</StreamTransClient.dll><SystemTransform.dll>2,5,2,8</SystemTransform.dll><NetStream.dll>1,0,5,59</NetStream.dll></Platform></FileVersion>";window.GetSelectWndInfo=function(e){if(ct()){f=e;var n=[];n.push("<RealPlayInfo>"),n.push("<SelectWnd>"+e+"</SelectWnd>"),n.push("</RealPlayInfo>"),d.cbSelWnd&&d.cbSelWnd(S.loadXML(n.join("")))}else{var r=S.loadXML(e);if(t.$XML(r).find("SelectWnd",!0).length>0){f=parseInt(t.$XML(r).find("SelectWnd").eq(0).text(),10),null===g&&Y();var n=[];n.push("<RealPlayInfo>"),n.push("<SelectWnd>"+f+"</SelectWnd>"),n.push("</RealPlayInfo>"),d.cbSelWnd&&d.cbSelWnd(S.loadXML(n.join("")))}else if(t.$XML(r).find("DoubleClickWnd",!0).length>0){var s=parseInt(t.$XML(r).find("DoubleClickWnd").eq(0).text(),10);h="0"===t.$XML(r).find("IsFullScreen").eq(0).text(),d.cbDoubleClickWnd&&d.cbDoubleClickWnd(s,h)}}},window.WindowDblClick=function(e){h=e,d.cbDoubleClickWnd&&d.cbDoubleClickWnd(f,h)},window.ZoomInfoCallback=function(e){var t=y.findWndIndexByIndex(f);if(-1!=t){var n=I[t];if(t=y.findDeviceIndexByIP(n.szDeviceIdentify),-1!=t){var r=P[t];r.oProtocolInc.set3DZoom(r,n,e,{success:function(){},error:function(){}})}}},window.PluginEventHandler=function(e,t,n){ct()?d.cbEvent&&d.cbEvent(e,t,n):(w==t||G==t?y.I_Stop(e):X==t?y.I_StopRecord(e):W==t&&y.I_StopVoiceTalk(),d.cbEvent&&d.cbEvent(t,e,n))},window.GetHttpInfo=function(e,t){Pt.prototype.processCallback(e,t)},window.RemoteConfigInfo=function(e){d.cbRemoteConfig&&d.cbRemoteConfig(e)},window.KeyBoardEventInfo=function(e){100===parseInt(e,10)&&(h=!1,d.cbDoubleClickWnd&&d.cbDoubleClickWnd(f,h))};var N=function(){if(d.bDebugMode){var e=F(arguments);m._alert(e)}},F=function(){for(var e=arguments[0],t=1;t<arguments.length;t++)e=e.replace("%s",arguments[t]);return e},V=function(e){var t=e.indexOf(":");return t>-1?e.substring(0,t):e},U=function(e){return"undefined"==typeof e},j=function(e){return"[object Object]"===Object.prototype.toString.call(e)},O=function(e,t){var n="",r={type:"GET",async:!1,succes
}if(-1==i)return N("获取端口号失败"),n.error&&n.error(),void 0;S.extend(l,{urlProtocol:o,cgi:s,iPort:i,iChannelID:a}),r=this.findWndIndexByIndex(l.iWndIndex),-1==r&&(ct()?(l.szStartTime=l.szStartTime.replace(" ","T")+"Z",l.szEndTime=l.szEndTime.replace(" ","T")+"Z",d.oProtocolInc.startPlayback(d,l).then(function(){n.success&&n.success()},function(){n.error&&n.error()})):(l.szStartTime=l.szStartTime.replace(/[-:]/g,"").replace(" ","T")+"Z",l.szEndTime=l.szEndTime.replace(/[-:]/g,"").replace(" ","T")+"Z",d.oProtocolInc.startPlayback(d,l).then(function(){n.success&&n.success()},function(){d.iRtspPort=-1,n.error&&n.error()})))}else n.error&&n.error()},this.I_ReversePlayback=function(e,n){var r=this.findDeviceIndexByIP(e),s=-1,o="",i="",a=-1,u=-1,c=0,l=S.dateFormat(new Date,"yyyy-MM-dd"),d={iWndIndex:f,iStreamType:1,iChannelID:1,szStartTime:l+" 00:00:00",szEndTime:l+" 23:59:59"};if(S.extend(d,n),-1!=r){at(P[r]);var p=P[r];if(ct())return s;var h=parseInt(t.$XML(g).find("ProtocolType").eq(0).text(),10);if(h==H&&p.oStreamCapa.bSupportShttpPlay?(o=p.oProtocolInc.CGI.startShttpReversePlayback,i="http://",c=d.iStreamType-1,u=d.iChannelID<=p.iAnalogChannelNum?d.iChannelID:p.oStreamCapa.iIpChanBase+parseInt(d.iChannelID,10)-p.iAnalogChannelNum-1,u=100*u+c,U(d.iPort)?"https://"==p.szHttpProtocol?(-1==p.iHttpPort&&(p.iHttpPort=nt(p).iHttpPort),a=p.iHttpPort):a=p.iCGIPort:(p.iHttpPort=d.iPort,a=d.iPort)):(o=p.oProtocolInc.CGI.startPlayback,i="rtsp://",c=d.iStreamType,u=100*d.iChannelID+c,U(d.iRtspPort)||(p.iRtspPort=d.iRtspPort),-1==p.iRtspPort&&(p.iRtspPort=nt(p).iRtspPort),a=p.iRtspPort),-1==a)return N("获取端口号失败"),s;S.extend(d,{urlProtocol:i,cgi:o,iPort:a,iChannelID:u}),r=this.findWndIndexByIndex(d.iWndIndex),-1==r&&(d.szStartTime=d.szStartTime.replace(/[-:]/g,"").replace(" ","T")+"Z",d.szEndTime=d.szEndTime.replace(/[-:]/g,"").replace(" ","T")+"Z",s=p.oProtocolInc.reversePlayback(p,d))}return-1==s&&(p.iRtspPort=-1),s},this.I_Frame=function(e){var t={iWndIndex:f};j(e)?S.extend(t,e):U(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=I[n],s=r.iPlayStatus;if(s==A||s==L)if(ct())p.JS_FrameForward(t.iWndIndex).then(function(){r.iPlayStatus=L,t.success&&t.success()},function(){t.error&&t.error()});else{var o=p.HWP_FrameForward(t.iWndIndex);0==o?(r.iPlayStatus=L,t.success&&t.success()):t.error&&t.error()}else t.error&&t.error()}else t.error&&t.error()},this.I_Pause=function(e){var t={iWndIndex:f};j(e)?S.extend(t,e):U(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=I[n],s=r.iPlayStatus,o=-1;if(s==A)o=M;else{if(s!=q)return t.error&&t.error(),void 0;o=R}if(ct())p.JS_Pause(t.iWndIndex).then(function(){r.iPlayStatus=o,t.success&&t.success()},function(){t.error&&t.error()});else{var i=p.HWP_Pause(t.iWndIndex);0==i?(r.iPlayStatus=o,t.success&&t.success()):t.error&&t.error()}}else t.error&&t.error()},this.I_Resume=function(e){var t={iWndIndex:f};j(e)?S.extend(t,e):U(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=I[n],s=r.iPlayStatus,o=-1;if(s==M||s==L)o=A;else{if(s!=R)return t.error&&t.error(),void 0;o=q}if(ct())p.JS_Resume(t.iWndIndex).then(function(){r.iPlayStatus=o,t.success&&t.success()},function(){t.error&&t.error()});else{var i=p.HWP_Resume(t.iWndIndex);0==i?(r.iPlayStatus=o,t.success&&t.success()):t.error&&t.error()}}else t.error&&t.error()},this.I_PlaySlow=function(e){var t={iWndIndex:f};j(e)?S.extend(t,e):U(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=I[n];if(r.iPlayStatus==A)if(ct()){var s=p.JS_GetWndStatus(t.iWndIndex);s.iRate<=-4?t.error&&t.error():p.JS_Slow(t.iWndIndex).then(function(){t.success&&t.success()},function(){t.error&&t.error()})}else{var o=p.HWP_Slow(t.iWndIndex);0==o?t.success&&t.success():t.error&&t.error()}else t.error&&t.error()}else t.error&&t.error()},this.I_PlayFast=function(e){var t={iWndIndex:f};j(e)?S.extend(t,e):U(e)||(t.iWndIndex=e);var n=this.findWndIndexByIndex(t.iWndIndex);if(-1!=n){var r=I[n];if(r.iPlayStatus==A)if(ct()){var s=p.JS_GetWndStatus(t.iWndIndex);s.i
break;case 10:case 11:u=this.CGI.ptzControl,a="<?xml version='1.0' encoding='UTF-8'?><PTZData><zoom>"+i[r.iPTZIndex].speed+"</zoom>"+"</PTZData>";break;case 12:case 13:u=this.CGI.ptzFocus,a="<?xml version='1.0' encoding='UTF-8'?><FocusData><focus>"+i[r.iPTZIndex].speed+"</focus>"+"</FocusData>";break;case 14:case 15:u=this.CGI.ptzIris,a="<?xml version='1.0' encoding='UTF-8'?><IrisData><iris>"+i[r.iPTZIndex].speed+"</iris>"+"</IrisData>";break;default:return r.error&&r.error(),void 0}o=u!=this.CGI.ptzFocus&&u!=this.CGI.ptzIris||e.szDeviceType!=k&&e.szDeviceType!=E&&e.szDeviceType!=Z?s<=e.iAnalogChannelNum?F(u.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):n.bShttpIPChannel?F(u.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum):F(u.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):F(u.ipc,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID);var c=new Pt,l={type:"PUT",url:o,async:!1,auth:e.szAuth,data:a,success:null,error:null};S.extend(l,r),S.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()},It.prototype.setPreset=function(e,t,n){var r=t.iChannelID,s="",o="";s=r<=e.iAnalogChannelNum?F(this.CGI.setPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?F(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):F(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),o="<?xml version='1.0' encoding='UTF-8'?>",o+="<PTZPreset>",o+="<id>"+n.iPresetID+"</id>",e.szDeviceType!=E&&(o+="<presetName>Preset"+n.iPresetID+"</presetName>"),o+="</PTZPreset>";var i=new Pt,a={type:"PUT",url:s,auth:e.szAuth,data:o,success:null,error:null};S.extend(a,n),S.extend(a,{success:function(e){n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),i.setRequestParam(a),i.submitRequest()},It.prototype.goPreset=function(e,t,n){var r=t.iChannelID,s="";s=r<=e.iAnalogChannelNum?F(this.CGI.goPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):t.bShttpIPChannel?F(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID-e.oStreamCapa.iIpChanBase+1+e.iAnalogChannelNum,n.iPresetID):F(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID);var o=new Pt,i={type:"PUT",url:s,auth:e.szAuth,success:null,error:null};S.extend(i,n),S.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()},It.prototype.overlayInfo=function(){return szUrl=this.CGI.overlayInfo.analog},It.prototype.recordSearch=function(e,n){var r="",s="",i=n.iChannelID,a=n.iStreamType,u=n.szStartTime.replace(" ","T")+"Z",c=n.szEndTime.replace(" ","T")+"Z";r=F(this.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),s="<?xml version='1.0' encoding='UTF-8'?><CMSearchDescription><searchID>"+new o+"</searchID>"+"<trackList><trackID>"+(100*i+a)+"</trackID></trackList>"+"<timeSpanList>"+"<timeSpan>"+"<startTime>"+u+"</startTime>"+"<endTime>"+c+"</endTime>"+"</timeSpan>"+"</timeSpanList>"+"<maxResults>40</maxResults>"+"<searchResultPostion>"+n.iSearchPos+"</searchResultPostion>"+"<metadataList>"+"<metadataDescriptor>//metadata.ISAPI.org/VideoMotion</metadataDescriptor>"+"</metadataList>"+"</CMSearchDescription>";var l=new Pt,d={type:"POST",url:r,auth:e.szAuth,data:s,success:null,error:null};S.extend(d,n),S.extend(d,{success:function(e){var r=[];r.push("<CMSearchResult>"),r.push("<responseStatus>"+t.$XML(e).find("responseStatus").eq(0).text()+"</responseStatus>"),r.push("<responseStatusStrg>"+t.$XML(e).find("responseStatusStrg").eq(0).text()+"</responseStatusStrg>"),r.push("<numOfMatches>"+t.$XML(e).find("numOfMatches").eq(0).text()+"</numOfMatches>"),r.push("<matchList>");for(var s=t.$XML(e).find("searchMatchItem",!0),o=0,i=s.length;i>o;o++){var a=s[o];r.push("<searchMatchItem>"),r.push("<trackID>"+t.$XML(a).find("trackID").eq(0).text()+"</trackI
S.extend(i,n),S.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()},mt.prototype.goPreset=function(e,t,n){var r=(t.iChannelID,"");r=F(this.CGI.goPreset,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID);var s=new Pt,o={type:"PUT",url:r,auth:e.szAuth,success:null,error:null};S.extend(o,n),S.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()},mt.prototype.recordSearch=function(e,n){var r="",s="",i=n.iChannelID,a=n.iStreamType,u=n.szStartTime.replace(" ","T")+"Z",c=n.szEndTime.replace(" ","T")+"Z";r=F(this.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),s="<?xml version='1.0' encoding='UTF-8'?><CMSearchDescription><searchID>"+new o+"</searchID>"+"<trackList><trackID>"+(100*i+a)+"</trackID></trackList>"+"<timeSpanList>"+"<timeSpan>"+"<startTime>"+u+"</startTime>"+"<endTime>"+c+"</endTime>"+"</timeSpan>"+"</timeSpanList>"+"<maxResults>40</maxResults>"+"<searchResultPostion>"+n.iSearchPos+"</searchResultPostion>"+"<metadataList>"+"<metadataDescriptor>//metadata.psia.org/VideoMotion</metadataDescriptor>"+"</metadataList>"+"</CMSearchDescription>";var l=new Pt,d={type:"POST",url:r,auth:e.szAuth,data:s,success:null,error:null};S.extend(d,n),S.extend(d,{success:function(e){var r=[];r.push("<CMSearchResult>"),r.push("<responseStatus>"+t.$XML(e).find("responseStatus").eq(0).text()+"</responseStatus>"),r.push("<responseStatusStrg>"+t.$XML(e).find("responseStatusStrg").eq(0).text()+"</responseStatusStrg>"),r.push("<numOfMatches>"+t.$XML(e).find("numOfMatches").eq(0).text()+"</numOfMatches>"),r.push("<matchList>");for(var s=t.$XML(e).find("searchMatchItem",!0),o=0,i=s.length;i>o;o++){var a=s[o];r.push("<searchMatchItem>"),r.push("<trackID>"+t.$XML(a).find("trackID").eq(0).text()+"</trackID>"),r.push("<startTime>"+t.$XML(a).find("startTime").eq(0).text()+"</startTime>"),r.push("<endTime>"+t.$XML(a).find("endTime").eq(0).text()+"</endTime>"),r.push("<playbackURI>"+S.escape(t.$XML(a).find("playbackURI").eq(0).text())+"</playbackURI>"),r.push("<metadataDescriptor>"+t.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1]+"</metadataDescriptor>"),r.push("</searchMatchItem>")}r.push("</matchList>"),r.push("</CMSearchResult>"),e=S.loadXML(r.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),l.setRequestParam(d),l.submitRequest()},mt.prototype.startPlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,o=e.szIP;"rtsp://"===t.urlProtocol&&(o=V(o));var i=F(t.cgi,t.urlProtocol,o,t.iPort,t.iChannelID,r,s),a=p.HWP_Play(i,e.szAuth,n,r,s);if(0==a){var u=new ht;u.iIndex=n,u.szIP=e.szIP,u.iCGIPort=e.iCGIPort,u.szDeviceIdentify=e.szDeviceIdentify,u.iChannelID=t.iChannelID,u.iPlayStatus=A,I.push(u)}return a},mt.prototype.reversePlayback=function(e,t){var n=t.iWndIndex,r=t.szStartTime,s=t.szEndTime,o=e.szIP;"rtsp://"===t.urlProtocol&&(o=V(o));var i=F(t.cgi,t.urlProtocol,o,t.iPort,t.iChannelID,r,s),a=p.HWP_ReversePlay(i,e.szAuth,n,r,s);if(0==a){var u=new ht;u.iIndex=n,u.szIP=e.szIP,u.iCGIPort=e.iCGIPort,u.szDeviceIdentify=e.szDeviceIdentify,u.iChannelID=t.iChannelID,u.iPlayStatus=q,I.push(u)}return a},mt.prototype.startDownloadRecord=function(e,t){var n=F(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),r="<?xml version='1.0' encoding='UTF-8'?><downloadRequest><playbackURI> "+S.escape(t.szPlaybackURI)+"</playbackURI>"+"</downloadRequest>";return p.HWP_StartDownload(n,e.szAuth,t.szFileName,r,t.bDateDir)},mt.prototype.exportDeviceConfig=function(e){var t=F(this.CGI.downloaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return ct()?-1:p.HWP_ExportDeviceConfig(t,e.szAuth,"",0)},mt.prototype.importDeviceConfig=function(e,t){var n=F(this.CGI.uploaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return p.HWP_ImportDeviceConfig(n,e.szAuth,t.szFileName,0)},mt.prototype.restart=function(e,t){var n=F(this.CGI.restart,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new Pt,s={type:"PUT",url:n,auth:e.szAuth,success:null,e