From 042c78fcf6f8766f14745d112480eeb838391f98 Mon Sep 17 00:00:00 2001 From: ym Date: Thu, 4 Jun 2026 09:25:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E9=81=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E9=9D=A2=E4=B8=8D=E8=83=BD=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/common/channelPlayer/index.vue | 41 +++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/web/src/views/common/channelPlayer/index.vue b/web/src/views/common/channelPlayer/index.vue index 4f7c35d58..05efaffb4 100755 --- a/web/src/views/common/channelPlayer/index.vue +++ b/web/src/views/common/channelPlayer/index.vue @@ -20,12 +20,14 @@ > { + if (this.$refs[this.activePlayer]) { + this.$refs[this.activePlayer].play(this.videoUrl) + } + }) }, openDialog: function(tab, channelId, param) { if (this.showVideoDialog) { @@ -493,32 +502,34 @@ export default { this.streamId = streamInfo.stream this.app = streamInfo.app this.mediaServerId = streamInfo.mediaServerId - this.playFromStreamInfo(false, streamInfo) + this.playFromStreamInfo(hasAudio, streamInfo) }, - getUrlByStreamInfo() { + getUrlByStreamInfo(streamInfo) { console.log(this.streamInfo) - let streamInfo = this.streamInfo - if (this.streamInfo.transcodeStream) { - streamInfo = this.streamInfo.transcodeStream + let info = streamInfo || this.streamInfo + if (!info) { + return '' } + if (info.transcodeStream) { + info = info.transcodeStream + } + let videoUrl if (location.protocol === 'https:') { - this.videoUrl = streamInfo[this.player[this.activePlayer][1]] + videoUrl = info[this.player[this.activePlayer][1]] } else { - this.videoUrl = streamInfo[this.player[this.activePlayer][0]] + videoUrl = info[this.player[this.activePlayer][0]] } - return this.videoUrl + return videoUrl }, 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.hasAudio = realHasAudio !== undefined ? realHasAudio : this.hasAudio + this.$nextTick(() => { + if (this.$refs[this.activePlayer]) { this.$refs[this.activePlayer].play(this.getUrlByStreamInfo(streamInfo)) - }) - } + } + }) }, close: function() { console.log('关闭视频')