From bb45006ff7f7944f75b26fde6ac8c1d5be84a4e8 Mon Sep 17 00:00:00 2001 From: haiyangcui Date: Mon, 14 Dec 2020 17:11:47 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=88=A0=E9=99=A4=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E7=89=87=E5=A4=B4=E7=89=87=E5=B0=BE=E9=87=8C=E7=9A=84=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit e9f81faf708b7e500dc4e45098c332c0de7ae405. --- src/components/Play.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 425eea3..12ecf27 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -353,7 +353,8 @@ export default { children: 'children' }, startPosition: { min: '00', sec: '00' }, // 对应调略输入框 - endPosition: { min: '00', sec: '00' } + endPosition: { min: '00', sec: '00' }, + skipendStatus: false // 是否跳过了片尾 } }, filters: { @@ -581,6 +582,7 @@ export default { if (VIDEO_DETAIL_CACHE[key].endPosition) this.xg.addProgressDot(this.xg.duration - VIDEO_DETAIL_CACHE[key].endPosition, '片尾') }) this.videoPlaying() + this.skipendStatus = false this.xg.once('ended', () => { if (m3u8Arr.length > 1 && (m3u8Arr.length - 1 > index)) { this.video.info.time = 0 @@ -1345,8 +1347,11 @@ export default { const key = this.video.key + '@' + this.video.info.id if (VIDEO_DETAIL_CACHE[key] && VIDEO_DETAIL_CACHE[key].endPosition) { const time = this.xg.duration - VIDEO_DETAIL_CACHE[key].endPosition - this.xg.currentTime - if (time <= 0) { - this.xg.emit('ended') + if (time > 0 && time < 0.3) { // timeupdate每0.25秒触发一次,只有自然播放到该点时才会跳过片尾 + if (!this.skipendStatus) { + this.skipendStatus = true + this.xg.emit('ended') + } } } })