From 73560d9e7ec766d8aca966f888e09157e490874b Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Wed, 19 Feb 2025 10:53:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E7=A0=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=88=B7=E6=96=B0=EF=BC=8C=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E5=AF=B9=E8=AE=B2=E9=80=89=E6=8B=A9=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/common/mediaInfo.vue | 14 +++- .../src/components/dialog/devicePlayer.vue | 84 ++++++++----------- 2 files changed, 47 insertions(+), 51 deletions(-) diff --git a/web_src/src/components/common/mediaInfo.vue b/web_src/src/components/common/mediaInfo.vue index 4591bcd4..52f640ed 100644 --- a/web_src/src/components/common/mediaInfo.vue +++ b/web_src/src/components/common/mediaInfo.vue @@ -34,11 +34,11 @@ export default { components: {}, created() { this.getMediaInfo(); - setInterval(this.getMediaInfo, 1000) }, data() { return { - info: {} + info: {}, + task: null, }; }, methods: { @@ -62,6 +62,16 @@ export default { console.log(error); }); }, + startTask: function () { + this.task = setInterval(this.getMediaInfo, 1000) + }, + stopTask: function () { + if (this.task) { + window.clearInterval(this.task); + this.task = null; + } + + }, formatByteSpeed: function (){ let bytesSpeed = this.info.bytesSpeed let num = 1024.0 //byte diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index 22f2da6d..3286b3c4 100755 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -231,14 +231,19 @@ - - + +
- + + + + + + 喊话(Broadcast) + 对讲(Talk) +
{ - this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo)) - }); - } - }, - close: function () { - console.log('关闭视频'); - if (!!this.$refs[this.activePlayer]){ - this.$refs[this.activePlayer].pause(); - } - this.videoUrl = ''; - this.coverPlaying = false; - this.showVideoDialog = false; - this.stopBroadcast() - }, + playFromStreamInfo: function (realHasAudio, streamInfo) { + this.showVideoDialog = true; + this.hasaudio = realHasAudio && this.hasaudio; + if (this.$refs[this.activePlayer]) { + this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo)) + }else { + this.$nextTick(() => { + this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo)) + }); + } + }, + close: function () { + console.log('关闭视频'); + if (!!this.$refs[this.activePlayer]){ + this.$refs[this.activePlayer].pause(); + } + this.videoUrl = ''; + this.coverPlaying = false; + this.showVideoDialog = false; + this.stopBroadcast() + }, copySharedInfo: function (data) { console.log('复制内容:' + data);