From e568053b95778e4cf74233124607c38791412cfd Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Wed, 30 Dec 2020 22:48:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=B9=E5=8A=A8=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E5=BF=AB=E6=8D=B7=E9=94=AE=E8=AE=BE=E7=BD=AE=E7=89=87?= =?UTF-8?q?=E5=A4=B4=E7=89=87=E5=B0=BE=E6=A0=87=E8=AE=B0=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 8a482ab..695a8be 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -681,19 +681,19 @@ export default { this.DetailCache[cacheKey] = res res = this.DetailCache[cacheKey] this.name = res.name - VIDEO_DETAIL_CACHE[cacheKey] = { + VIDEO_DETAIL_CACHE[cacheKey] = Object.assign(VIDEO_DETAIL_CACHE[cacheKey] || { }, { list: res.fullList, name: res.name - } + }) resolve(res.fullList) }) } else { res = this.DetailCache[cacheKey] this.name = res.name - VIDEO_DETAIL_CACHE[cacheKey] = { + VIDEO_DETAIL_CACHE[cacheKey] = Object.assign(VIDEO_DETAIL_CACHE[cacheKey] || { }, { list: res.fullList, name: res.name - } + }) resolve(res.fullList) } }) @@ -702,9 +702,13 @@ export default { const db = await history.find({ site: this.video.key, ids: this.video.info.id }) let time = this.xg.currentTime || 0 let duration = this.xg.duration || 0 + let startPosition = 0 + let endPosition = 0 if (db) { time = time || db.time duration = duration || db.duration + startPosition = db.startPosition + endPosition = db.endPosition await history.remove(db.id) } if (isOnline) { @@ -719,6 +723,8 @@ export default { index: this.video.info.index, time: time, duration: duration, + startPosition: startPosition, + endPosition: endPosition, detail: this.video.detail, onlinePlay: isOnline } @@ -729,7 +735,7 @@ export default { async setProgressDotEvent (position, timespan, text) { // 根据跳略时长在进度条上添加标记, position为位置, timespan为时长,text为标记文本(title) const key = this.video.key + '@' + this.video.info.id const db = await history.find({ site: this.video.key, ids: this.video.info.id }) - if (db && this.xg && VIDEO_DETAIL_CACHE[key].list.length > 1) { + if (db && this.xg && this.right.list.length > 1) { this[position] = { min: '' + parseInt(timespan / 60), sec: '' + parseInt(timespan % 60) } const positionTime = position === 'endPosition' ? this.xg.duration - timespan : timespan if (db[position]) this.xg.removeProgressDot(position === 'endPosition' ? this.xg.duration - db[position] : db[position])