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()