From 991dd0ea41c611ef3ec3cb410c13820b4054fcb5 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 15 Nov 2024 22:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=BB=E7=BA=BF=E4=BA=91?= =?UTF-8?q?=E5=8F=B0=E6=8E=A7=E5=88=B6=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dialog/jtDevicePlayer.vue | 208 +++++++----------- 1 file changed, 75 insertions(+), 133 deletions(-) diff --git a/web_src/src/components/dialog/jtDevicePlayer.vue b/web_src/src/components/dialog/jtDevicePlayer.vue index f1bc5015f..337080b73 100755 --- a/web_src/src/components/dialog/jtDevicePlayer.vue +++ b/web_src/src/components/dialog/jtDevicePlayer.vue @@ -154,39 +154,61 @@ -
-
-
- -
+
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+
+ +
-
- -
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
- -
+
开启雨刷 @@ -200,49 +222,13 @@ 关补光灯 - - 光圈调大 - - 光圈调小 - - - - 焦距调大 - - 焦距调小 - -
-

- 无法播放或者没有声音?   试一试  - 转码播放 - 停止转码 -

-
-

暂无数据

-
- 流 {{ index }} -
-

格式: {{ item.codec_id_name }}

-

类型: 视频

-

分辨率: {{ item.width }} x {{ item.height }}

-

帧率: {{ item.fps }}

-
-
-

格式: {{ item.codec_id_name }}

-

类型: 音频

-

采样位数: {{ item.sample_bit }}

-

采样率: {{ item.sample_rate }}

-
-
- -
- +
@@ -269,11 +255,13 @@ import rtcPlayer from '../dialog/rtcPlayer.vue' import LivePlayer from '@liveqing/liveplayer' import crypto from 'crypto' import jessibucaPlayer from '../common/jessibuca.vue' +import mediaInfo from '../common/mediaInfo.vue' export default { name: 'devicePlayer', props: {}, components: { + mediaInfo, LivePlayer, jessibucaPlayer, rtcPlayer, }, computed: { @@ -307,7 +295,6 @@ export default { streamId: '', app: '', mediaServerId: '', - convertKey: '', deviceId: '', channelId: '', tabActiveName: 'media', @@ -326,7 +313,6 @@ export default { scanSpeed: 100, scanGroup: 0, tracks: [], - coverPlaying: false, tracksLoading: false, showPtz: true, showRrecord: true, @@ -415,70 +401,17 @@ export default { }, getUrlByStreamInfo() { console.log(this.streamInfo) + let streamInfo = this.streamInfo + if (this.streamInfo.transcodeStream) { + streamInfo = this.streamInfo.transcodeStream; + } if (location.protocol === "https:") { - this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]] + this.videoUrl = streamInfo[this.player[this.activePlayer][1]] } else { - this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]] + this.videoUrl = streamInfo[this.player[this.activePlayer][0]] } return this.videoUrl; - }, - coverPlay: function () { - var that = this; - this.coverPlaying = true; - this.$refs[this.activePlayer].pause() - that.$axios({ - method: 'post', - url: '/api/play/convert/' + that.streamId - }).then(function (res) { - if (res.data.code === 0) { - that.convertKey = res.data.key; - setTimeout(() => { - that.isLoging = false; - that.playFromStreamInfo(false, res.data.data); - }, 2000) - } else { - that.isLoging = false; - that.coverPlaying = false; - that.$message({ - showClose: true, - message: '转码失败', - type: 'error' - }); - } - }).catch(function (e) { - console.log(e) - that.coverPlaying = false; - that.$message({ - showClose: true, - message: '播放错误', - type: 'error' - }); - }); - }, - convertStopClick: function () { - this.convertStop(() => { - this.$refs[this.activePlayer].play(this.videoUrl) - }); - }, - convertStop: function (callback) { - var that = this; - that.$refs.videoPlayer.pause() - this.$axios({ - method: 'post', - url: '/api/play/convertStop/' + this.convertKey - }).then(function (res) { - if (res.data.code == 0) { - console.log(res.data.msg) - } else { - console.error(res.data.msg) - } - if (callback) callback(); - }).catch(function (e) { - }); - that.coverPlaying = false; - that.convertKey = ""; - // if (callback )callback(); }, playFromStreamInfo: function (realHasAudio, streamInfo) { @@ -500,10 +433,6 @@ export default { this.videoUrl = ''; this.coverPlaying = false; this.showVideoDialog = false; - if (this.convertKey != '') { - this.convertStop(); - } - this.convertKey = '' this.stopBroadcast() }, @@ -606,7 +535,10 @@ export default { copyUrl: function (dropdownItem) { console.log(dropdownItem) this.$copyText(dropdownItem).then((e) => { - this.$message.success("成功拷贝到粘贴板"); + this.$message.success({ + showClose: true, + message: "成功拷贝到粘贴板" + }) }, (e) => { }) @@ -968,4 +900,14 @@ export default { width: 80%; padding: 0 10%; } +.el-dialog__body{ + padding: 10px 20px; +} +.ptz-btn-box { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + height: 3rem; + line-height: 4rem; +}