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);