From 0e4d68fa89ee818cc503ce4a80d467bf6d9be76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Wed, 4 Oct 2023 08:09:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=92=AD=E6=94=BE=E6=97=B6?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 5 +++-- public/music.js | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 3357dde..6aa9503 100644 --- a/public/index.html +++ b/public/index.html @@ -120,10 +120,11 @@ // 指针达到音乐数据大小则结束加载 const mediaLoader = async () => { while (bufferCursor !== item.size) { - if (musicList.audio.paused && musicList.audio.src === '') { - console.log('音乐数据加载中, 但是音频已经停止播放') + if (musicList.audio.paused && musicList.audio.currentTime !== 0) { + console.log('音乐暂停') break } + console.log('当前播放进度', musicList.audio.currentTime) const 当前播放进度 = musicList.audio.currentTime const 当前结束时间 = sourceBuffer.buffered.length && sourceBuffer.buffered.end(0) const 剩余数据长度 = buffer.byteLength - bufferCursor diff --git a/public/music.js b/public/music.js index f69b4c5..43b8d17 100644 --- a/public/music.js +++ b/public/music.js @@ -161,7 +161,6 @@ export default class MusicList { return console.error('暂停播放:音乐播放器不是播放状态!') } this.audio.pause() - this.audio.src = '' this.event.onstop(this.playing) this.playing = null }