From c4283e2da064f810ece167173e858fa5d2c2190d Mon Sep 17 00:00:00 2001 From: Hunlongyu Date: Wed, 28 Oct 2020 17:30:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=93=20=E4=BC=98=E5=8C=96=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E9=A1=B5=E5=9B=BE=E6=A0=87,=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=81=9C=E6=AD=A2=E6=92=AD=E6=94=BE=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=8F=90=E7=A4=BA.=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 54 +++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index b09a636..a75aa8d 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -3,17 +3,6 @@
『第 {{(video.info.index + 1)}} 集』{{name}} - - - - - - - - - - -
@@ -66,8 +55,14 @@ + + 精简模式 + + + + - 精简模式 + 使用第三方播放器 @@ -89,6 +84,14 @@ + + + 复制调试信息 + + + + + 上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集
@@ -301,6 +304,9 @@ export default { methods: { ...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']), async getUrls () { + if (this.video.key === '') { + return false + } this.name = '' if (this.timer !== null) { clearInterval(this.timer) @@ -1073,18 +1079,17 @@ export default { let timerID ev.forEach(item => { this.xg.root.addEventListener(item, () => { - if (!this.xg.fullscreen) { - return + if (this.xg && this.xg.fullscreen) { + const videoTitle = document.querySelector('.xg-view-videoTitle') + videoTitle.style.display = 'block' + clearTimeout(timerID) + timerID = setTimeout(() => { + // 播放中自动消失 + if (this.xg && !this.xg.paused) { + videoTitle.style.display = 'none' + } + }, 3000) } - const videoTitle = document.querySelector('.xg-view-videoTitle') - videoTitle.style.display = 'block' - clearTimeout(timerID) - timerID = setTimeout(() => { - // 播放中自动消失 - if (this.xg && !this.xg.paused) { - videoTitle.style.display = 'none' - } - }, 3000) }) }) @@ -1096,6 +1101,8 @@ export default { if (this.xg.fullscreen) { this.xg.exitFullscreen() } + clearInterval(this.timer) + this.video.key = '' this.xg.src = '' this.config.src = '' this.xg.destroy(false) @@ -1103,6 +1110,7 @@ export default { this.name = '' this.right.list = [] this.showNext = false + this.getAllhistory() setTimeout(() => { this.xg = new Hls(this.config) this.playerInstall()