Files
SIPAIIS_WMS_JSSW/WebRoot/plugins/camera/webVideoCtrl.js

3 lines
72 KiB
JavaScript
Raw Normal View History

2026-01-16 14:13:44 +08:00
!function(e){if(!e.WebVideoCtrl){var t=function(){function t(){this.id=this.createUUID()}var n="100%",r="100%",o="",i="",a={szContainerID:"",szColorProperty:"",szOcxClassId:"clsid:E7EF736D-B4E6-4A5A-BA94-732D71107808",szMimeTypes:"application/hwp-webvideo-plugin",iWndowType:1,iPlayMode:2,bDebugMode:!1,cbSelWnd:null,cbEvent:null},c=null,u=0,l=[],p=[],d=null,P=null,h=null,I=null,f=this,m=null,C=1,S=2,y=200,g=0,v=1,x=2,T=3,z=4,D=5,A=6,b=0,M=2,q=3,L=21,R=0,G="IPCamera",X="IPDome",H="IPZoom",w="<?xml version='1.0' encoding='utf-8'?><FileVersion><Platform name='win32'><npWebVideoPlugin.dll>3,0,5,56</npWebVideoPlugin.dll><WebVideoActiveX.ocx>3,0,5,56</WebVideoActiveX.ocx><PlayCtrl.dll>6,5,2,40</PlayCtrl.dll><StreamTransClient.dll>1,1,2,11</StreamTransClient.dll><SystemTransform.dll>2,3,0,10</SystemTransform.dll><NetStream.dll>1,0,5,57</NetStream.dll><HCNetSDK.dll>4,2,6,7</HCNetSDK.dll><ShowRemConfig.dll>3,1,2,14</ShowRemConfig.dll></Platform></FileVersion>";e.GetSelectWndInfo=function(e){var t=I.loadXML(e);u=parseInt(s.$XML(t).find("SelectWnd").eq(0).text(),10);var n=[];n.push("<RealPlayInfo>"),n.push("<SelectWnd>"+u+"</SelectWnd>"),n.push("</RealPlayInfo>"),a.cbSelWnd&&a.cbSelWnd(I.loadXML(n.join("")))},e.ZoomInfoCallback=function(e){var t=f.findWndIndexByIndex(u);if(-1!=t){var s=p[t];if(t=f.findDeviceIndexByIP(s.szIP),-1!=t){var n=l[t];n.oProtocolInc.set3DZoom(n,s,e,{success:function(){},error:function(){}})}}},e.PluginEventHandler=function(e,t,s){Z("插件事件PluginEventHandler iEventType%s iParam1: %s, iParam2: %s",e,t,s),b==e||M==e?f.I_Stop(t):L==e?f.I_StopRecord(t):q==e&&f.I_StopVoiceTalk(),a.cbEvent&&a.cbEvent(e,t,s)},e.GetHttpInfo=function(e,t){Z("http响应返回http状态%s, http数据%s",e,t),et.prototype.processCallback(e,t)};var Z=function(){if(a.bDebugMode){var e=k(arguments);d._alert(e)}},k=function(){for(var e=arguments[0],t=1;t<arguments.length;t++)e=e.replace("%s",arguments[t]);return e},W=function(e){return"undefined"==typeof e},_=function(){var e="";if(I.browser().msie)e="<object classid='"+a.szOcxClassId+"' codebase='' standby='Waiting...' id='"+o+"' width='"+n+"' height='"+r+"' align='center' ><param name='wndtype' value='"+a.iWndowType+"'><param name='playmode' value='"+a.iPlayMode+"'><param name='colors' value='"+a.szColorProperty+"'></object>";else for(var t=navigator.mimeTypes.length,s=0;t>s;s++)navigator.mimeTypes[s].type.toLowerCase()==a.szMimeTypes&&(e="<embed align='center' type='"+a.szMimeTypes+"' width='"+n+"' height='"+r+"' name='"+i+"' wndtype='"+a.iWndowType+"' playmode='"+a.iPlayMode+"' colors='"+a.szColorProperty+"'>");return e},E=function(){var e=c.HWP_GetLocalConfig();m=I.loadXML(e)},N=function(e){f.I_GetDeviceInfo(e.szIP,{success:function(t){e.szDeviceType=s.$XML(t).find("deviceType").eq(0).text()}}),f.I_GetAnalogChannelInfo(e.szIP,{success:function(t){e.iAnalogChannelNum=s.$XML(t).find("VideoInputChannel",!0).length}}),f.I_GetAudioInfo(e.szIP,{success:function(t){var n=s.$XML(t).find("audioCompressionType",!0);if(n.length>0){var r=s.$XML(n).eq(0).text(),o=0;"G.711ulaw"==r?o=1:"G.711alaw"==r?o=2:"G.726"==r&&(o=3),e.iAudioType=o}}})},B=function(e){var t=-1,s=-1,n=-1,r=null;if(O(e))r=F(e),t=r.iRtspPort,n=r.iDevicePort;else{for(var o=V(e),i=!1,a=0;a<o.length;a++)if(o[a].ipv4==e.szIP||o[a].ipv6==e.szIP){i=!0;break}i?r=F(e):(r=U(e),-1==t&&-1==n&&(r=F(e))),t=r.iRtspPort,s=r.iHttpPort,n=r.iDevicePort}return r},F=function(e){var t=-1,n=-1,r=-1;return e.oProtocolInc.getPortInfo(e,{async:!1,success:function(e){for(var o=s.$XML(e).find("AdminAccessProtocol",!0),i=0,a=o.length;a>i;i++)"rtsp"===s.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase()&&(t=parseInt(s.$XML(o).eq(i).find("portNo").eq(0).text(),10)),"http"===s.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase()&&(n=parseInt(s.$XML(o).eq(i).find("portNo").eq(0).text(),10)),"dev_manage"===s.$XML(o).eq(i).find("protocol").eq(0).text().toLowerCase()&&(r=parseInt(s.$XML(o).eq(i).find("portNo").eq(0).text(),10))},error:function(){t=-1,n=-1,r=-1}}),{iRtspPort:t,iHttpPort:n,iDevicePort:r}},U=function(e){var t=-1,n=-1,r=-
n.push("<VideoInputChannelList>");for(var r=s.$XML(e).find("VideoInputChannel",!0),o=0,i=r.length;i>o;o++){var a=r[o];n.push("<VideoInputChannel>"),n.push("<id>"+s.$XML(a).find("id").eq(0).text()+"</id>"),n.push("<inputPort>"+s.$XML(a).find("inputPort").eq(0).text()+"</inputPort>"),n.push("<name>"+I.escape(s.$XML(a).find("name").eq(0).text())+"</name>"),n.push("<videoFormat>"+s.$XML(a).find("videoFormat").eq(0).text()+"</videoFormat>"),n.push("</VideoInputChannel>")}n.push("</VideoInputChannelList>"),e=I.loadXML(n.join("")),t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),r.setRequestParam(o),r.submitRequest()},tt.prototype.getDigitalChannelInfo=function(e,t){var n=k(this.CGI.getDigitalChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),r=new et,o={type:"GET",url:n,auth:e.szAuth,success:null,error:null};I.extend(o,t),I.extend(o,{success:function(e){var n=[];n.push("<InputProxyChannelStatusList>");for(var r=s.$XML(e).find("InputProxyChannelStatus",!0),o=0,i=r.length;i>o;o++){var a=r[o];n.push("<InputProxyChannelStatus>"),n.push("<id>"+s.$XML(a).find("id").eq(0).text()+"</id>"),n.push("<sourceInputPortDescriptor>"),n.push("<proxyProtocol>"+s.$XML(a).find("proxyProtocol").eq(0).text()+"</proxyProtocol>"),n.push("<addressingFormatType>"+s.$XML(a).find("addressingFormatType").eq(0).text()+"</addressingFormatType>"),n.push("<ipAddress>"+s.$XML(a).find("ipAddress").eq(0).text()+"</ipAddress>"),n.push("<managePortNo>"+s.$XML(a).find("managePortNo").eq(0).text()+"</managePortNo>"),n.push("<srcInputPort>"+s.$XML(a).find("srcInputPort").eq(0).text()+"</srcInputPort>"),n.push("<userName>"+I.escape(s.$XML(a).find("userName").eq(0).text())+"</userName>"),n.push("<streamType>"+s.$XML(a).find("streamType").eq(0).text()+"</streamType>"),n.push("<online>"+s.$XML(a).find("online").eq(0).text()+"</online>"),n.push("</sourceInputPortDescriptor>"),n.push("</InputProxyChannelStatus>")}n.push("</InputProxyChannelStatusList>"),e=I.loadXML(n.join("")),t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),r.setRequestParam(o),r.submitRequest()},tt.prototype.getZeroChannelInfo=function(e,t){var s=k(this.CGI.getZeroChannelInfo,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},tt.prototype.getStreamChannels=function(e,t){if(0!=e.iAnalogChannelNum)var s=k(this.CGI.getStreamChannels.analog,e.szHttpProtocol,e.szIP,e.iCGIPort);else var s=k(this.CGI.getStreamChannels.digital,e.szHttpProtocol,e.szIP,e.iCGIPort);var n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},tt.prototype.getPPPoEStatus=function(e,t){var s=k(this.CGI.getPPPoEStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},tt.prototype.getUPnPPortStatus=function(e,t){var s=k(this.CGI.getUPnPPortStatus,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},tt.prototype.getNetworkBond=function(e,t){var s=k(this.CGI.getNetworkBond,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},tt.prototype.getNetworkInterface=function(e,t){var s=k(this.CGI.getNetworkInterface,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"GET",url:s,auth:e.szAuth,success:null,error:null};I.extend(
var u=new et,l={type:"POST",url:r,auth:e.szAuth,data:o,success:null,error:null};I.extend(l,n),I.extend(l,{success:function(e){var t=[];t.push("<CMSearchResult>"),t.push("<responseStatus>"+s.$XML(e).find("responseStatus").eq(0).text()+"</responseStatus>"),t.push("<responseStatusStrg>"+s.$XML(e).find("responseStatusStrg").eq(0).text()+"</responseStatusStrg>"),t.push("<numOfMatches>"+s.$XML(e).find("numOfMatches").eq(0).text()+"</numOfMatches>"),t.push("<matchList>");for(var r=s.$XML(e).find("searchMatchItem",!0),o=0,i=r.length;i>o;o++){var a=r[o];t.push("<searchMatchItem>"),t.push("<trackID>"+s.$XML(a).find("trackID").eq(0).text()+"</trackID>"),t.push("<startTime>"+s.$XML(a).find("startTime").eq(0).text()+"</startTime>"),t.push("<endTime>"+s.$XML(a).find("endTime").eq(0).text()+"</endTime>"),t.push("<playbackURI>"+I.escape(s.$XML(a).find("playbackURI").eq(0).text())+"</playbackURI>"),t.push("<metadataDescriptor>"+s.$XML(a).find("metadataDescriptor").eq(0).text().split("/")[1]+"</metadataDescriptor>"),t.push("</searchMatchItem>")}t.push("</matchList>"),t.push("</CMSearchResult>"),e=I.loadXML(t.join("")),n.success&&n.success(e)},error:function(e,t){n.error&&n.error(e,t)}}),u.setRequestParam(l),u.submitRequest()},st.prototype.startPlayback=function(e,t){var s=t.iWndIndex,n=t.szStartTime,r=t.szEndTime,o=k(t.cgi,t.urlProtocol,e.szIP,t.iPort,t.iChannelID,n,r),i=c.HWP_Play(o,e.szAuth,s,n,r);if(0==i){var a=new Q;a.iIndex=s,a.szIP=e.szIP,a.iChannelID=t.iChannelID,a.iPlayStatus=x,p.push(a)}return i},st.prototype.reversePlayback=function(e,t){var s=t.iWndIndex,n=t.szStartTime,r=t.szEndTime,o=k(t.cgi,t.urlProtocol,e.szIP,t.iPort,t.iChannelID,n,r),i=c.HWP_ReversePlay(o,e.szAuth,s,n,r);if(0==i){var a=new Q;a.iIndex=s,a.szIP=e.szIP,a.iChannelID=t.iChannelID,a.iPlayStatus=D,p.push(a)}return i},st.prototype.startDownloadRecord=function(e,t){var s=k(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),n="<?xml version='1.0' encoding='UTF-8'?><downloadRequest><playbackURI> "+I.escape(t.szPlaybackURI)+"</playbackURI></downloadRequest>";return c.HWP_StartDownload(s,e.szAuth,t.szFileName,n)},st.prototype.exportDeviceConfig=function(e){var t=k(this.CGI.deviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return c.HWP_ExportDeviceConfig(t,e.szAuth,"",0)},st.prototype.importDeviceConfig=function(e,t){var s=k(this.CGI.deviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return c.HWP_ImportDeviceConfig(s,e.szAuth,t.szFileName,0)},st.prototype.restart=function(e,t){var s=k(this.CGI.restart,e.szHttpProtocol,e.szIP,e.iCGIPort),n=new et,r={type:"PUT",url:s,auth:e.szAuth,success:null,error:null};I.extend(r,t),I.extend(r,{success:function(e){t.success&&t.success(e)},error:function(e,s){t.error&&t.error(e,s)}}),n.setRequestParam(r),n.submitRequest()},st.prototype.restore=function(e,t,s){var n=k(this.CGI.restore,e.szHttpProtocol,e.szIP,e.iCGIPort,t),r=new et,o={type:"PUT",url:n,auth:e.szAuth,success:null,error:null};I.extend(o,s),I.extend(o,{success:function(e){s.success&&s.success(e)},error:function(e,t){s.error&&s.error(e,t)}}),r.setRequestParam(o),r.submitRequest()},st.prototype.startUpgrade=function(e,t){var s=k(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort),n=k(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);return c.HWP_StartUpgrade(s,n,e.szAuth,t.szFileName)},st.prototype.set3DZoom=function(e,t,s,n){var r=k(this.CGI.set3DZoom,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID),o=new et,i={type:"PUT",url:r,data:s,auth:e.szAuth,success:null,error:null};I.extend(i,n),I.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()};var nt=function(){};nt.prototype._alert=function(e){a.bDebugMode&&console.log(e)},function(t){var s=function(e){this.elems=[],this.length=0,this.length=this.elems.push(e)};s.prototype.find=function(e,t){var s=this.elems[this.length-1].getElementsByTagName(e);return this.length=this.elems.push(s),t?s:this},s.prototype.eq=function(e,t){var s=this.elems[this.length-1].length,n=null;return s>0&&s>e&&(n=this.elems[this