FastBee/docker/data/nginx/vue/static/js/chunk-5344ade2.d10b282b.js
2025-07-07 09:21:15 +08:00

1 line
10 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5344ade2","chunk-00213f14"],{"1b7a":function(e,t,n){"use strict";n("abf5")},6827:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"f",(function(){return c})),n.d(t,"e",(function(){return l}));var i=n("b775");function a(e,t,n){return Object(i["a"])({url:"/sip/record/devquery/"+e+"/"+t,method:"get",params:n})}function r(e){return Object(i["a"])({url:"/sip/record/serverRecord/list",method:"get",params:e})}function s(e){return Object(i["a"])({url:"/sip/record/serverRecord/date/list",method:"get",params:e})}function o(e){return Object(i["a"])({url:"/sip/record/serverRecord/file/list",method:"get",params:e})}function c(e,t){return Object(i["a"])({url:"/sip/record/play/"+e+"/"+t,method:"get"})}function l(e,t,n){return Object(i["a"])({url:"/sip/record/download/"+e+"/"+t,method:"get",params:n})}},"97d6":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"root"},[n("div",{staticClass:"container-shell"},[n("div",{ref:"container",attrs:{id:"container"}})])])},a=[],r=n("c7eb"),s=n("1da1"),o=(n("a9e3"),n("ac1f"),n("00b4"),n("f5a7")),c={},l={name:"player",props:{playerinfo:{type:Object,default:null}},mounted:function(){console.log(this._uid)},watch:{playerinfo:function(e,t){console.log("playerinfo 发生变化"),this.playinfo=e,this.playinfo&&""!==this.playinfo.playtype&&(this.playtype=this.playinfo.playtype)}},jessibuca:null,data:function(){return{isPlaybackPause:!1,useWebGPU:!1,isInit:!1,playinfo:{},playtype:"play",operateBtns:{}}},beforeDestroy:function(){},created:function(){this.playinfo=this.playerinfo,this.playinfo&&""!==this.playinfo.playtype&&(this.playtype=this.playinfo.playtype),this.init()},methods:{init:function(){var e=this,t="gpu"in navigator;t?(console.log("支持webGPU"),this.useWebGPU=!0):(console.log("暂不支持webGPU降级到webgl渲染"),this.useWebGPU=!1);var n=this.isMobile()||this.isPad();n&&window.VConsole&&new window.VConsole,this.$nextTick((function(){e.initplayer()}))},initplayer:function(){this.isPlaybackPause=!1,this.initconf(),c[this._uid]=new window.JessibucaPro({container:this.$refs.container,decoder:"/js/jessibuca-pro/decoder-pro.js",videoBuffer:Number(.2),isResize:!1,useWCS:!1,useMSE:!1,useSIMD:!0,wcsUseVideoRender:!1,loadingText:"加载中",debug:!1,showBandwidth:!0,showPlaybackOperate:!0,operateBtns:this.operateBtns,forceNoOffscreen:!0,isNotMute:!1,showPerformance:!1,playbackForwardMaxRateDecodeIFrame:4,useWebGPU:this.useWebGPU});var e=c[this._uid];this.initcallback(e),this.isInit=!0},initconf:function(){"play"===this.playtype?this.operateBtns={fullscreen:!0,zoom:!0,ptz:!0,play:!0}:this.operateBtns={fullscreen:!0,zoom:!0,play:!0,ptz:!1}},initcallback:function(e){var t=this;e.on("error",(function(e){console.log("error"),console.log(e),t.destroy()})),e.on("pause",(function(e){console.log("pause success!"),console.log(e)})),e.on("stats",(function(e){console.log("stats is",e)})),e.on("timeout",(function(){console.log("timeout")})),e.on("playbackPreRateChange",(function(t){e.forward(t)}));var n=0,i=0;e.on("timeUpdate",(function(e){i=parseInt(e/6e4),n!==i&&n++})),e.on(JessibucaPro.EVENTS.ptz,(function(e){console.log("ptz arrow",e),t.handlePtz(e)}))},registercallback:function(e,t){c[this._uid]&&c[this._uid].on(e,t)},isMobile:function(){return/iphone|ipad|android.*mobile|windows.*phone|blackberry.*mobile/i.test(window.navigator.userAgent.toLowerCase())},isPad:function(){return/ipad|android(?!.*mobile)|tablet|kindle|silk/i.test(window.navigator.userAgent.toLowerCase())},play:function(e){c[this._uid]&&c[this._uid].play(e)},pause:function(){c[this._uid]&&c[this._uid].pause()},replay:function(e){var t=this;c[this._uid]?c[this._uid].destroy().then((function(){t.initplayer(),t.play(e)})):(this.initplayer(),this.play(e))},handlePtz:function(e){var t=0,n=0;"left"===e?t=2:"right"===e?t=1:"up"===e?n=1:"down"===e&&(n=2);var i={leftRight:t,upDown:n,moveSpeed:125};this.playinfo&&""!==this.playinfo.playtype&&Object(o["c"])(this.playinfo.deviceId,this.playinfo.channelId,i).then(function(){var e=Object(s["a"])(Object(r["a"])().mark((function e(t){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},playback:function(e,t){c[this._uid]&&(c[this._uid].playback(e,{playList:t,fps:25,showControl:!0,showRateBtn:!0,isUseFpsRender:!0,isCacheBeforeDecodeForFpsRender:!1,supportWheel:!0,rateConfig:[{label:"正常",value:1},{label:"2倍",value:2},{label:"4倍",value:4},{label:"8倍",value:8}]}),this.isPlaybackPause=!1)},playbackPause:function(){c[this._uid]&&(c[this._uid].playbackPause(),this.isPlaybackPause=!0)},replayback:function(e,t){var n=this;c[this._uid]?c[this._uid].destroy().then((function(){n.initplayer(),n.playback(e,t)})):(this.initplayer(),this.playback(e,t))},destroy:function(){var e=this;c[this._uid]&&c[this._uid].destroy().then((function(){e.initplayer()}))},close:function(){c[this._uid]&&c[this._uid].close()}}},u=l,d=(n("1b7a"),n("2877")),p=Object(d["a"])(u,i,a,!1,null,"263ca075",null);t["default"]=p.exports},abf5:function(e,t,n){},e2de:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return o})),n.d(t,"h",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d}));var i=n("b775");function a(e){return Object(i["a"])({url:"/sip/channel/list",method:"get",params:e})}function r(e){return Object(i["a"])({url:"/sip/channel/"+e,method:"get"})}function s(e,t){return Object(i["a"])({url:"/sip/channel/"+e,method:"post",data:t})}function o(e){return Object(i["a"])({url:"/sip/channel/"+e,method:"delete"})}function c(e,t){return Object(i["a"])({url:"/sip/player/play/"+e+"/"+t,method:"get"})}function l(e,t,n){return Object(i["a"])({url:"/sip/player/playback/"+e+"/"+t,method:"get",params:n})}function u(e,t){return Object(i["a"])({url:"/sip/player/closeStream/"+e+"/"+t,method:"get"})}function d(e,t,n,a){return Object(i["a"])({url:"/sip/player/playbackSeek/"+e+"/"+t+"/"+n,method:"get",params:a})}},ecd9:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("el-row",[n("span",{staticStyle:{"margin-left":"10px"},attrs:{prop:"channelName"}},[e._v("通道名称:")]),n("el-select",{attrs:{placeholder:"请选择",size:"small"},on:{change:function(t){return e.changeChannel()}},model:{value:e.channelId,callback:function(t){e.channelId=t},expression:"channelId"}},e._l(e.channelList,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),n("span",{staticStyle:{margin:"10px 10px 10px 30px"}},[e._v("开启直播录像:")]),n("el-switch",{staticStyle:{"border-radius":"10px"},attrs:{"active-color":"#13ce66","inactive-color":"#c4c6c9",disabled:""===e.channelId},on:{change:e.startPlayRecord},model:{value:e.playrecord,callback:function(t){e.playrecord=t},expression:"playrecord"}})],1),n("player",{ref:"player",staticClass:"components-container",attrs:{playerinfo:e.playinfo}})],1)},a=[],r=(n("d81d"),n("97d6")),s=n("e2de"),o=n("6827"),c={name:"device-live-stream",components:{player:r["default"]},props:{device:{type:Object,default:null}},watch:{device:function(e,t){this.deviceInfo=e,this.deviceInfo.channelId&&(this.channelId=this.deviceInfo.channelId,this.changeChannel()),this.deviceInfo&&0!==this.deviceInfo.deviceId&&(this.queryParams.deviceSipId=this.deviceInfo.serialNumber,this.deviceId=this.device.serialNumber)}},data:function(){return{deviceInfo:{},deviceId:"",channelId:"",streamId:"",ssrc:"",playurl:"",playinfo:{},playrecord:!1,playrecording:!1,playing:!1,channelList:[],queryParams:{pageNum:1,pageSize:10,deviceSipId:null,channelSipId:null}}},created:function(){this.queryParams.deviceSipId=this.device.serialNumber,this.deviceId=this.device.serialNumber,this.getList(),this.playinfo={playtype:"play",deviceId:this.device.serialNumber}},beforeDestroy:function(){},destroyed:function(){this.closeStream()},methods:{getList:function(){var e=this;this.loading=!0,Object(s["e"])(this.queryParams).then((function(t){e.channelList=t.rows.map((function(e){return{value:e.channelSipId,label:e.channelName}})),console.log(e.channelList)}))},changeChannel:function(){this.playinfo.channelId=this.channelId,this.sendDevicePush()},sendDevicePush:function(){var e=this;this.channelId?Object(s["h"])(this.deviceId,this.channelId).then((function(t){var n=t.data;e.streamId=n.streamId,e.playurl=n.playurl,e.$refs.player.isInit||e.$refs.player.init(),e.$refs.player.play(n.playurl),e.playing=!0})):console.log("直播通道: ["+this.channelId+"]")},startPlayRecord:function(){var e=this;this.deviceId=this.queryParams.deviceSipId,this.channelId?this.playrecord?(this.closeStream(),Object(o["f"])(this.deviceId,this.channelId).then((function(t){console.log("开始录像:"+e.deviceId+" : "+e.channelId),e.playrecording=!0;var n=t.data;e.streamId=n.streamId,e.playurl=n.playurl,e.$refs.player.isInit||e.$refs.player.init(),e.$refs.player.play(n.playurl),e.playing=!0}))):(this.playrecording=!1,this.closeStream(),this.sendDevicePush()):console.log("直播录像通道: ["+this.channelId+"]")},closeStream:function(){var e=this;!0!==this.playrecording&&this.playing&&this.streamId&&(Object(s["b"])(this.deviceId,this.streamId).then((function(t){e.streamId="",e.ssrc="",e.playurl=""})),this.playing=!1)},destroy:function(){this.playing&&this.streamId&&this.$refs.player.destroy()}}},l=c,u=n("2877"),d=Object(u["a"])(l,i,a,!1,null,null,null);t["default"]=d.exports},f5a7:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return s}));var i=n("b775");function a(e){return Object(i["a"])({url:"/sip/device/listchannel/"+e,method:"get"})}function r(e){return Object(i["a"])({url:"/sip/device/sipid/"+e,method:"delete"})}function s(e,t,n){return Object(i["a"])({url:"/sip/ptz/direction/"+e+"/"+t,method:"post",data:n})}}}]);