{"remainingRequest":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\videoPlayer.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\src\\views\\frontScreens\\components\\videoPlayer.vue","mtime":1684458238824},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bbsl-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bbsl-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//\n//\n//\n//\n//\n//\n//\n\r\nconst IS_MOVE_DEVICE = document.body.clientWidth < 992 // 是否移动设备\r\nconst MSE_IS_SUPPORT = !!window.MediaSource // 是否支持mse\r\nexport default {\r\n props: {\r\n split: {\r\n type: String,\r\n },\r\n defaultSplit: {\r\n type: Number,\r\n default: 2,\r\n },\r\n hadSiteOption: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n siteOption: {\r\n type: Array,\r\n default: () => {\r\n return []\r\n },\r\n },\r\n siteCode: {\r\n type: String,\r\n default: '',\r\n },\r\n },\r\n data() {\r\n return {\r\n splitDataDefault: [\r\n {\r\n value: 1,\r\n icon: 'yifenping',\r\n text: '1X1',\r\n },\r\n {\r\n value: 2,\r\n icon: 'sifenping',\r\n text: '2X2',\r\n },\r\n {\r\n value: 3,\r\n icon: 'jiufenping',\r\n text: '3X3',\r\n },\r\n {\r\n value: 4,\r\n icon: 'shiliufenping',\r\n text: '4X4',\r\n },\r\n ],\r\n splitData2: [\r\n {\r\n value: 1,\r\n icon: 'yifenping',\r\n text: '1X1',\r\n },\r\n {\r\n value: 2,\r\n icon: 'sifenping',\r\n text: '2X2',\r\n },\r\n ],\r\n isMoveDevice: IS_MOVE_DEVICE,\r\n player: null,\r\n splitNum: IS_MOVE_DEVICE ? 1 : this.defaultSplit,\r\n mseSupport: MSE_IS_SUPPORT,\r\n tabActive: MSE_IS_SUPPORT ? 'mse' : 'decoder',\r\n labelCol: {\r\n span: 5,\r\n },\r\n wrapperCol: {\r\n span: 18,\r\n },\r\n urls: {\r\n realplay: 'ws://183.64.175.153:559/openUrl/pxvGV5C',\r\n talk: 'ws://183.64.175.153:559/openUrl/pxvGV5C',\r\n playback: 'ws://183.64.175.153:559/openUrl/pxvGV5C',\r\n },\r\n playback: {\r\n startTime: '2021-07-26T00:00:00',\r\n endTime: '2021-07-26T23:59:59',\r\n // valueFormat: moment.HTML5_FMT.DATETIME_LOCAL_SECONDS,\r\n seekStart: '2021-07-26T12:00:00',\r\n rate: '',\r\n },\r\n muted: true,\r\n volume: 50,\r\n volumeOnSvg: {\r\n template:\r\n '',\r\n },\r\n volumeOffSvg: {\r\n template:\r\n '',\r\n },\r\n videoinfo: '视频加载中...',\r\n }\r\n },\r\n computed: {\r\n mode: function () {\r\n return this.tabActive === 'mse' ? 0 : 1\r\n },\r\n splitData() {\r\n if (this.split == 1) {\r\n return []\r\n } else if (this.split == 2) {\r\n return this.splitData2\r\n } else {\r\n return this.splitDataDefault\r\n }\r\n },\r\n },\r\n methods: {\r\n init() {\r\n window.addEventListener('resize', () => {\r\n this.player.JS_Resize()\r\n })\r\n },\r\n arrangeWindow(num) {\r\n console.log(1)\r\n this.splitNum = num\r\n this.player.JS_ArrangeWindow(this.splitNum).then(\r\n () => {\r\n console.log(\r\n `arrangeWindow to ${this.splitNum}x${this.splitNum} success`\r\n )\r\n },\r\n (e) => {\r\n console.error(e)\r\n }\r\n )\r\n },\r\n createPlayer() {\r\n let vm = this\r\n this.player = new window.JSPlugin({\r\n szId: 'player',\r\n szBasePath: '/',\r\n iMaxSplit: 4, //this.split == 1 ? 1 : 4,\r\n iCurrentSplit: IS_MOVE_DEVICE ? 1 : this.defaultSplit,\r\n openDebug: true,\r\n oStyle: {\r\n borderSelect: IS_MOVE_DEVICE ? '#000' : '#FFCC00',\r\n },\r\n })\r\n\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(this, vm)\r\n console.log('fullScreen callback: ', bFull)\r\n if (!bFull && vm.defaultSplit == 1) {\r\n vm.arrangeWindow(1)\r\n }\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 wholeFullScreen() {\r\n console.log(this.siteOption, 'siteOption')\r\n if (this.siteOption && this.siteOption.length) {\r\n let length = this.siteOption.length\r\n let split = 1\r\n if (length > 9) {\r\n split = 4\r\n } else if (length > 4) {\r\n split = 3\r\n } else if (length > 1) {\r\n split = 2\r\n }\r\n this.arrangeWindow(split)\r\n }\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 realplay() {\r\n let {player, mode, urls} = this,\r\n index = player.currentWindowIndex,\r\n playURL = urls.realplay\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 this.videoinfo = ''\r\n // 将index下移\r\n console.log(index)\r\n index++\r\n this.moveIndex(index)\r\n },\r\n (e) => {\r\n this.videoinfo = '播放失败,请重试'\r\n console.error(e)\r\n }\r\n )\r\n },\r\n moveIndex(windowIndex) {\r\n console.log(windowIndex)\r\n this.player.JS_SelectWnd(windowIndex).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 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 closeVideo() {\r\n this.stopPlay()\r\n this.videoinfo = '视频已关闭'\r\n this.$emit('close')\r\n },\r\n // 根据监控点获取视频流地址\r\n getSiteVideoURL(cameraIndexCode) {\r\n let query = {\r\n cameraIndexCode, // 监控点编码\r\n }\r\n this.$http\r\n .post('${portal}/biz/catalog/base/previewURLs', query)\r\n .then((res) => {\r\n if (res.data.state && res.data.value) {\r\n let data = res.data.value\r\n this.$nextTick(() => {\r\n this.useVideoURL(data)\r\n })\r\n } else {\r\n this.$message.warning('获取监控点资源失败!')\r\n }\r\n })\r\n },\r\n changeSite(val) {\r\n this.currentSite = val\r\n this.getSiteVideoURL(val)\r\n },\r\n useVideoURL(url) {\r\n this.videoinfo = '视频加载中...'\r\n console.log(url)\r\n this.urls.realplay = url\r\n this.realplay() // todo 这个解开就是播放\r\n // let query = {\r\n // cameraIndexCode: '110090628241674360', // 监控点编码\r\n // }\r\n // return new Promise((resolve,reject)=>{\r\n // this.$http\r\n // .post('${yhxt}/baseDataStatistics/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 },\r\n },\r\n mounted() {\r\n this.init()\r\n this.createPlayer()\r\n },\r\n}\r\n",null]}