{"remainingRequest":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\components\\videoPlayerHK.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\components\\videoPlayerHK.vue","mtime":1712171298892},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nconst MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse\r\nconst portal = window.context.portal\r\nexport default {\r\n name: 'videoPlayerDH',\r\n props: {\r\n wrapperName: {\r\n type: String,\r\n default: 'h5-play-wrap',\r\n },\r\n showWdn: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n showFull: {\r\n type: Boolean,\r\n default: true,\r\n },\r\n maxSplit: {\r\n type: Number,\r\n default: 4,\r\n },\r\n currentSplit: {\r\n type: Number,\r\n default: 2,\r\n },\r\n },\r\n data() {\r\n return {\r\n player: null,\r\n videoinfo: '',\r\n urls: {\r\n realplay: '',\r\n },\r\n mode: MSE_IS_SUPPORT ? 0 : 1,\r\n }\r\n },\r\n mounted() {\r\n this.createPlayer()\r\n },\r\n methods: {\r\n getVideoURL(val) {\r\n if (!val) return (this.videoinfo = '暂无视频')\r\n this.videoinfo = '视频加载中...'\r\n let query = {\r\n cameraIndexCode: val, // '50035800001310713876', // 监控点编码\r\n }\r\n this.$http\r\n .post(portal + '/cameras/manager/v1/getPreviewURLs', query)\r\n .then((res) => {\r\n if (res.data.state && res.data.value) {\r\n let data = JSON.parse(res.data.value)\r\n this.urls.realplay = data.url\r\n this.realplay()\r\n } else {\r\n this.videoinfo = '获取监控点资源失败!'\r\n this.$message.warning('获取监控点资源失败!')\r\n }\r\n })\r\n },\r\n realplay() {\r\n let {player, mode, urls} = this,\r\n index = player.currentWindowIndex,\r\n playURL = urls.realplay\r\n\r\n console.log(player, 'player')\r\n player\r\n .JS_Play(\r\n playURL,\r\n {\r\n playURL,\r\n mode,\r\n },\r\n index\r\n )\r\n .then(\r\n () => {\r\n console.log('realplay success')\r\n },\r\n (e) => {\r\n this.videoinfo = '播放失败,请重试!'\r\n console.error(e)\r\n }\r\n )\r\n },\r\n stopPlay() {\r\n this.player.JS_Stop().then(\r\n () => {\r\n this.playback.rate = 0\r\n console.log('stop realplay success')\r\n },\r\n (e) => {\r\n console.error(e)\r\n }\r\n )\r\n },\r\n init() {\r\n // 设置播放容器的宽高并监听窗口大小变化\r\n window.addEventListener('resize', () => {\r\n if (this.player) {\r\n this.player.JS_Resize()\r\n }\r\n })\r\n },\r\n createPlayer() {\r\n this.player = new window.JSPlugin({\r\n szId: 'player',\r\n szBasePath: '/',\r\n iMaxSplit: this.maxSplit,\r\n iCurrentSplit: this.currentSplit,\r\n openDebug: true,\r\n oStyle: {\r\n borderSelect: '#FFCC00',\r\n },\r\n })\r\n this.init()\r\n // 事件回调绑定\r\n this.player.JS_SetWindowControlCallback({\r\n windowEventSelect: function (iWndIndex) {\r\n //插件选中窗口回调\r\n console.log('windowSelect callback: ', iWndIndex)\r\n },\r\n pluginErrorHandler: function (iWndIndex, iErrorCode, oError) {\r\n //插件错误回调\r\n console.log(\r\n 'pluginError callback: ',\r\n iWndIndex,\r\n iErrorCode,\r\n oError\r\n )\r\n },\r\n windowEventOver: function (iWndIndex) {\r\n //鼠标移过回调\r\n //console.log(iWndIndex);\r\n },\r\n windowEventOut: function (iWndIndex) {\r\n //鼠标移出回调\r\n //console.log(iWndIndex);\r\n },\r\n windowEventUp: function (iWndIndex) {\r\n //鼠标mouseup事件回调\r\n //console.log(iWndIndex);\r\n },\r\n windowFullCcreenChange: function (bFull) {\r\n //全屏切换回调\r\n console.log('fullScreen callback: ', bFull)\r\n },\r\n firstFrameDisplay: function (iWndIndex, iWidth, iHeight) {\r\n //首帧显示回调\r\n console.log(\r\n 'firstFrame loaded callback: ',\r\n iWndIndex,\r\n iWidth,\r\n iHeight\r\n )\r\n },\r\n performanceLack: function () {\r\n //性能不足回调\r\n console.log('performanceLack callback: ')\r\n },\r\n })\r\n },\r\n onChangeWdnNum(item) {\r\n let splitNum = item\r\n this.player.JS_ArrangeWindow(splitNum).then(\r\n () => {\r\n console.log(\r\n `arrangeWindow to ${splitNum}x${splitNum} success`\r\n )\r\n },\r\n (e) => {\r\n console.error(e)\r\n }\r\n )\r\n },\r\n onSetFull() {\r\n this.player.JS_FullScreenDisplay(true).then(\r\n () => {\r\n console.log(`wholeFullScreen success`)\r\n },\r\n (e) => {\r\n console.error(e)\r\n }\r\n )\r\n },\r\n },\r\n beforeDestroy() {},\r\n}\r\n",null]}