From 13c64a95fab3834e3ee95410e477b0caac47ff29 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sun, 25 Aug 2019 00:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E5=8A=A8=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=E6=92=AD=E6=94=BE=E8=BF=9B=E5=BA=A6=E6=9D=A1=E6=97=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=81=8F=E5=B7=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 2 ++ src/renderer/components/core/Player.vue | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 03c682f4..b90f87c0 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,3 +1,5 @@ ### 修复 - 修复设置界面更新出错时仍然显示更新下载中的问题 +- 修复手动定位播放进度条时存在偏差的问题 +- 屏蔽播放器中没有歌曲时对进度条的点击 diff --git a/src/renderer/components/core/Player.vue b/src/renderer/components/core/Player.vue index fc5480d4..19387833 100644 --- a/src/renderer/components/core/Player.vue +++ b/src/renderer/components/core/Player.vue @@ -111,8 +111,10 @@ export default { }, }, mounted() { - this.setProgessWidth() this.init() + this.$nextTick(() => { + this.setProgessWidth() + }) }, watch: { changePlay(n) { @@ -168,6 +170,7 @@ export default { this.volume = this.audio.volume = this.setting.player.volume this.audio.controls = false this.audio.autoplay = true + this.audio.preload = 'auto' this.audio.loop = this.setting.player.togglePlayMethod === 'singleLoop' this.audio.addEventListener('playing', () => { @@ -360,6 +363,7 @@ export default { this.clearAppTitle() }, setProgess(e) { + if (!this.audio.src) return this.audio.currentTime = (e.offsetX / this.pregessWidth) * this.maxPlayTime if (!this.isPlay) this.audio.play()