From 8cf3ec94d924197fec6e5bd93bb43bbe8d8bbf2e Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Wed, 30 Dec 2020 20:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86Play=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Play.vue | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/components/Play.vue b/src/components/Play.vue index 439cf81..8a482ab 100644 --- a/src/components/Play.vue +++ b/src/components/Play.vue @@ -350,7 +350,6 @@ export default { timer: null, scroll: false, isStar: false, - isTop: false, miniMode: false, mainWindowBounds: {}, searchTxt: '', @@ -700,7 +699,6 @@ export default { }) }, async videoPlaying (isOnline) { - this.changeVideo() 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 @@ -728,11 +726,6 @@ export default { this.updateStar() if (!isOnline) this.timerEvent() }, - changeVideo () { - win.setProgressBar(-1) - this.checkStar() - this.checkTop() - }, 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 }) @@ -766,10 +759,6 @@ export default { }, timerEvent () { this.timer = setInterval(async () => { - const endTime = this.xg.duration - const currentTime = this.xg.currentTime - const progress = parseFloat((currentTime / endTime).toFixed(2)) - win.setProgressBar(progress) const db = await history.find({ site: this.video.key, ids: this.video.info.id }) if (db) { const doc = { ...db } @@ -845,8 +834,11 @@ export default { const info = this.video.info const db = await star.find({ key: this.video.key, ids: info.id }) if (db) { + this.isStar = true db.index = info.index star.update(db.id, db) + } else { + this.isStar = false } }, async starEvent () { @@ -983,17 +975,6 @@ export default { fs.writeFileSync(filePath, str) return filePath }, - async checkStar () { - const db = await star.find({ key: this.video.key, ids: this.video.info.id }) - if (db) { - this.isStar = true - } else { - this.isStar = false - } - }, - checkTop () { - this.isTop = this.appState.windowIsOnTop - }, closeListEvent () { const lastRightType = this.right.type const lastChannelListState = this.state.showChannelList @@ -1157,8 +1138,6 @@ export default { if (this.xg) { if (this.xg.paused) { this.xg.play() - // 继续播放时,隐藏进度条 - win.setProgressBar(-1) } else { this.xg.pause() } @@ -1511,7 +1490,6 @@ export default { }) }, videoStop () { - win.setProgressBar(-1) if (this.xg.fullscreen) { this.xg.exitFullscreen() }