From 37a4ea2a56a7d607310b82a55f5488be3c356b4f Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Fri, 22 May 2026 14:14:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=92=AD=E6=94=BE=E6=95=88?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/common/jessibuca.vue | 14 ++++++++++---- web/src/views/common/mediaInfo.vue | 4 ++++ web/src/views/dialog/devicePlayer.vue | 11 +++++++---- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/web/src/views/common/jessibuca.vue b/web/src/views/common/jessibuca.vue index e3064ab0d..a6e76cb83 100755 --- a/web/src/views/common/jessibuca.vue +++ b/web/src/views/common/jessibuca.vue @@ -54,10 +54,12 @@ export default { } }, created() { - const paramUrl = decodeURIComponent(this.$route.params.url) - console.log(paramUrl) - if (!this.videoUrl && paramUrl) { - this.videoUrl = paramUrl + if (this.$route.params.url) { + const paramUrl = decodeURIComponent(this.$route.params.url) + console.log(paramUrl) + if (!this.videoUrl) { + this.videoUrl = paramUrl + } } this.btnDom = document.getElementById('buttonsBox') }, @@ -217,6 +219,10 @@ export default { this.play(this.videoUrl) }, play: function(url) { + if (!url) { + console.warn('Jessibuca -> invalid url, skip play') + return + } this.videoUrl = url console.log('Jessibuca -> url: ', url) if (!jessibucaPlayer[this._uid]) { diff --git a/web/src/views/common/mediaInfo.vue b/web/src/views/common/mediaInfo.vue index ec12a0aa4..e82e949af 100644 --- a/web/src/views/common/mediaInfo.vue +++ b/web/src/views/common/mediaInfo.vue @@ -44,6 +44,9 @@ export default { }, methods: { getMediaInfo: function() { + if (!this.app || !this.stream || !this.mediaServerId) { + return + } this.$store.dispatch('server/getMediaInfo', { app: this.app, stream: this.stream, @@ -52,6 +55,7 @@ export default { .then(data => { this.info = data }) + .catch(() => {}) }, startTask: function() { this.task = setInterval(this.getMediaInfo, 1000) diff --git a/web/src/views/dialog/devicePlayer.vue b/web/src/views/dialog/devicePlayer.vue index 2d71656cd..05568d315 100755 --- a/web/src/views/dialog/devicePlayer.vue +++ b/web/src/views/dialog/devicePlayer.vue @@ -473,10 +473,13 @@ export default { this.mediaServerId = streamInfo.mediaServerId this.playFromStreamInfo(false, streamInfo) }, - getUrlByStreamInfo() { - let streamInfo = this.streamInfo - if (this.streamInfo.transcodeStream) { - streamInfo = this.streamInfo.transcodeStream + getUrlByStreamInfo(streamInfo) { + streamInfo = streamInfo || this.streamInfo + if (!streamInfo) { + return '' + } + if (streamInfo.transcodeStream) { + streamInfo = streamInfo.transcodeStream } let videoUrl if (location.protocol === 'https:') {