From 0de27cb8b7a59cb2501005963f2bf37e85ccc3e0 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 14 Feb 2025 16:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=90=83=E6=9C=BA=E6=92=AD=E6=94=BE=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E4=BB=A5=E5=8F=8A=E9=80=89=E6=8B=A9=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/JessibucaH265/index.vue | 41 ++++++++++++- src/plugins/modal.js | 1 + src/utils/aescbc.js | 4 +- .../video/FixedCameraInspection.vue | 5 +- .../video/components/videoPlayNew.vue | 57 +++++++++++++++++-- vue.config.js | 4 +- 6 files changed, 97 insertions(+), 15 deletions(-) diff --git a/src/components/JessibucaH265/index.vue b/src/components/JessibucaH265/index.vue index aa523c8..459dae4 100644 --- a/src/components/JessibucaH265/index.vue +++ b/src/components/JessibucaH265/index.vue @@ -13,8 +13,8 @@ export default { return { jessibuca: null, playUrl: '', - qxToken: '', - qxInfo: {}, + qxToken: null, + qxInfo: null, fixedData: [], } }, @@ -47,6 +47,41 @@ export default { }, }, methods: { + // 父组件要求播放视频 + childPlayVideo(e) { + if (this.qxToken && this.qxInfo) { + const { puid, ballIndex } = e + this.playUrl = + this.qxInfo.q2Url + 'stream.flv?puid=' + puid + '&idx=' + ballIndex + '&stream=0&token=' + this.qxToken + if (this.jessibuca) { + // await this.jessibuca.destroy() + this.playvideo() + } else { + this.createJessibuca() + this.playvideo() + } + } else { + Promise.all([this.getQxToken(), this.selectVideoLoginInfo()]).then(async () => { + // 2. Promise.all 等待两个异步请求结束后 再组装url + const { puid, ballIndex } = e + this.playUrl = + this.qxInfo.q2Url + 'stream.flv?puid=' + puid + '&idx=' + ballIndex + '&stream=0&token=' + this.qxToken + }) + + if (this.jessibuca) { + // await this.jessibuca.destroy() + this.playvideo() + } else { + this.createJessibuca() + this.playvideo() + } + } + }, + + // 父组件要求关闭 + childClosedVideo() { + this.stopvideo() + }, createJessibuca() { this.jessibuca = new window.Jessibuca({ container: this.$refs.containerPlayer, @@ -99,7 +134,7 @@ export default { async stopvideo() { if (this.jessibuca) { await this.jessibuca.destroy() - jessibuca = null + this.jessibuca = null } }, diff --git a/src/plugins/modal.js b/src/plugins/modal.js index 747ee96..0304cde 100644 --- a/src/plugins/modal.js +++ b/src/plugins/modal.js @@ -18,6 +18,7 @@ export default { }, // 警告消息 msgWarning(content) { + Message.closeAll() Message.warning(content) }, // 弹出提示 diff --git a/src/utils/aescbc.js b/src/utils/aescbc.js index cc8912c..aa1625e 100644 --- a/src/utils/aescbc.js +++ b/src/utils/aescbc.js @@ -6,12 +6,12 @@ const cbc_iv = CryptoJS.enc.Utf8.parse('1234567812345678') * 默认参数需要加密 * @type {boolean} */ -const jia_mi = false +const jia_mi = true /** * 默认后台会自动加密 * @type {boolean} */ -const jie_mi = false +const jie_mi = true /** * 加密 * @param word diff --git a/src/views/screen/components/video/FixedCameraInspection.vue b/src/views/screen/components/video/FixedCameraInspection.vue index dfb5a9e..1f0496e 100644 --- a/src/views/screen/components/video/FixedCameraInspection.vue +++ b/src/views/screen/components/video/FixedCameraInspection.vue @@ -161,8 +161,9 @@ export default { }, //播放视频 playVideo(e) { - this.playItem = e - this.$refs.videoPlay.play(e) + // this.playItem = e + // this.$refs.videoPlay.play(e) + this.$refs.videoPlay.videoPlayNew(e) }, //设置图标样式 getImageSrc(type) { diff --git a/src/views/screen/components/video/components/videoPlayNew.vue b/src/views/screen/components/video/components/videoPlayNew.vue index 7f0a762..3d15d1a 100644 --- a/src/views/screen/components/video/components/videoPlayNew.vue +++ b/src/views/screen/components/video/components/videoPlayNew.vue @@ -127,8 +127,15 @@
-
- +
+