app.f8959017.js
7.1 KB
(function(t){function e(e){for(var o,a,s=e[0],l=e[1],c=e[2],d=0,f=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&f.push(i[a][0]),i[a]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(t[o]=l[o]);u&&u(e);while(f.length)f.shift()();return r.push.apply(r,c||[]),n()}function n(){for(var t,e=0;e<r.length;e++){for(var n=r[e],o=!0,s=1;s<n.length;s++){var l=n[s];0!==i[l]&&(o=!1)}o&&(r.splice(e--,1),t=a(a.s=n[0]))}return t}var o={},i={app:0},r=[];function a(e){if(o[e])return o[e].exports;var n=o[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=o,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)a.d(n,o,function(e){return t[e]}.bind(null,o));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=e,s=s.slice();for(var c=0;c<s.length;c++)e(s[c]);var u=l;r.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"034f":function(t,e,n){"use strict";n("85ec")},"131d":function(t,e,n){"use strict";n("6d3e")},"56d7":function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var o=n("2b0e"),i=n("5c96"),r=n.n(i),a=(n("0fae"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("index")],1)}),s=[],l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("body",[n("div",{staticClass:"operate",attrs:{id:"operate"}},[n("div",{staticClass:"module"},[n("div",{staticClass:"item"},[n("span",{staticClass:"label"},[t._v("监控点编号:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:t.cameraIndexCode,expression:"cameraIndexCode"}],attrs:{type:"text",value:""},domProps:{value:t.cameraIndexCode},on:{input:function(e){e.target.composing||(t.cameraIndexCode=e.target.value)}}})]),n("div",{staticClass:"item",staticStyle:{"margin-top":"20px","margin-left":"-20px"}},[t._v(" "),n("button",{staticClass:"btn",staticStyle:{padding:"0",margin:"0"},on:{click:t.startClickFn}},[t._v("预览")]),t._v(" "),n("button",{staticClass:"btn",staticStyle:{padding:"0",margin:"0"},on:{click:t.stopClickFn}},[t._v("停止全部预览")])])])]),n("div",{staticClass:"playWnd",staticStyle:{left:"109px",top:"133px"},attrs:{id:"playWnd"}})])},c=[],u=n("b85c"),d=(n("e9c4"),{name:"videoPlayerBox2",props:{},data:function(){return{oWebControl:void 0,initCount:0,pubKey:"",cameraIndexCode:void 0}},methods:{cbIntegrationCallBack:function(t){showCBInfo(JSON.stringify(t.responseMsg))},observeWrapper:function(){var t=this,e=new ResizeObserver((function(e){var n,o=Object(u["a"])(e);try{for(o.s();!(n=o.n()).done;){var i=n.value,r=i.contentRect;t.videoWidth=r.width,t.videoHeight=r.height,t.oWebControl&&t.oWebControl.JS_Resize(t.videoWidth,t.videoHeight),t.oWebControl&&t.setWndCover()}}catch(a){o.e(a)}finally{o.f()}}));e.observe(document.querySelector("#playWnd"))},setWndCover:function(){var t=$(window).width(),e=$(window).height(),n=$("#playWnd").get(0).getBoundingClientRect(),o=n.left<0?Math.abs(n.left):0,i=n.top<0?Math.abs(n.top):0,r=n.right-t>0?Math.round(n.right-t):0,a=n.bottom-e>0?Math.round(n.bottom-e):0;o=o>this.videoWidth?this.videoWidth:o,i=i>this.videoHeight?this.videoHeight:i,r=r>this.videoWidth?this.videoWidth:r,a=a>this.videoHeight?this.videoHeight:a,this.oWebControl.JS_RepairPartWindow(0,0,1001,600),0!=o&&this.oWebControl.JS_CuttingPartWindow(0,0,o,600),0!=i&&this.oWebControl.JS_CuttingPartWindow(0,0,1001,i),0!=r&&this.oWebControl.JS_CuttingPartWindow(1e3-r,0,r,600),0!=a&&this.oWebControl.JS_CuttingPartWindow(0,600-a,1e3,a)},initPlugin:function(){var t=this;this.oWebControl=new WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15909,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:function(){t.oWebControl.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then((function(){console.log("success"),t.oWebControl.JS_SetWindowControlCallback({cbIntegrationCallBack:t.cbIntegrationCallBack}),t.oWebControl.JS_CreateWnd("playWnd",1e3,600).then((function(){console.log("成功222",t),t.init()}))}),(function(){console.log("fail")}))},cbConnectError:function(){console.log(t,"that"),t.oWebControl=null,t.$message.error("插件未启动,正在尝试启动,请稍候..."),WebControl.JS_WakeUp("VideoWebPlugin://"),t.initCount++,t.initCount<3?setTimeout((function(){t.initPlugin()}),3e3):t.$message.error("插件启动失败,请检查插件是否安装!")},cbConnectClose:function(e){console.log("cbConnectClose"),t.oWebControl=null}})},init:function(){var t=this;this.getPubKey((function(){var e="24425536",n=t.setEncrypt("Qv1Eeo0eKqTohbJURaqS"),o="139.9.65.252",i=0,r=1443,a="D:/snap",s="D:/video",l="1x1",c=1,u="secret",d=1,f=1,p="0,16,256,257,258,259,260,512,513,514,515,516,517,768,769";t.oWebControl.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:e,secret:n,ip:o,playMode:i,port:r,snapDir:a,videoDir:s,layout:l,enableHTTPS:c,encryptedFields:u,showToolbar:d,showSmart:f,buttonIDs:p})}).then((function(e){t.oWebControl.JS_Resize(1e3,600)}))}))},getPubKey:function(t){var e=this;this.oWebControl.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then((function(n){console.log(n),n.responseMsg.data&&(e.pubKey=n.responseMsg.data,t())}))},setEncrypt:function(t){var e=new JSEncrypt;return e.setPublicKey(this.pubKey),e.encrypt(t)},startClickFn:function(){var t=this.cameraIndexCode,e=0,n=1,o=0,i=-1;this.oWebControl.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:t,streamMode:e,transMode:n,gpuMode:o,wndId:i})})},stopClickFn:function(){this.oWebControl&&this.oWebControl.JS_RequestInterface&&this.oWebControl.JS_RequestInterface({funcName:"stopAllPreview"})}},created:function(){this.initPlugin()},mounted:function(){var t=this;this.observeWrapper(),$(window).resize((function(){null!=t.oWebControl&&(t.oWebControl.JS_Resize(1e3,600),t.setWndCover())})),$(window).scroll((function(){null!=t.oWebControl&&(t.oWebControl.JS_Resize(1e3,600),t.setWndCover())}))},destroyed:function(){null!=this.oWebControl&&(this.oWebControl.JS_HideWnd(),this.oWebControl.JS_Disconnect().then((function(){}),(function(){})))}}),f=d,p=(n("131d"),n("2877")),b=Object(p["a"])(f,l,c,!1,null,"59190ddb",null),h=b.exports,C={name:"App",components:{index:h}},v=C,g=(n("034f"),Object(p["a"])(v,a,s,!1,null,null,null)),W=g.exports;o["default"].use(r.a),o["default"].config.productionTip=!1,new o["default"]({render:function(t){return t(W)}}).$mount("#app")},"6d3e":function(t,e,n){},"85ec":function(t,e,n){}});
//# sourceMappingURL=app.f8959017.js.map