修正播放时加载判断
This commit is contained in:
parent
85d4b194bc
commit
0e4d68fa89
@ -120,10 +120,11 @@
|
|||||||
// 指针达到音乐数据大小则结束加载
|
// 指针达到音乐数据大小则结束加载
|
||||||
const mediaLoader = async () => {
|
const mediaLoader = async () => {
|
||||||
while (bufferCursor !== item.size) {
|
while (bufferCursor !== item.size) {
|
||||||
if (musicList.audio.paused && musicList.audio.src === '') {
|
if (musicList.audio.paused && musicList.audio.currentTime !== 0) {
|
||||||
console.log('音乐数据加载中, 但是音频已经停止播放')
|
console.log('音乐暂停')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
console.log('当前播放进度', musicList.audio.currentTime)
|
||||||
const 当前播放进度 = musicList.audio.currentTime
|
const 当前播放进度 = musicList.audio.currentTime
|
||||||
const 当前结束时间 = sourceBuffer.buffered.length && sourceBuffer.buffered.end(0)
|
const 当前结束时间 = sourceBuffer.buffered.length && sourceBuffer.buffered.end(0)
|
||||||
const 剩余数据长度 = buffer.byteLength - bufferCursor
|
const 剩余数据长度 = buffer.byteLength - bufferCursor
|
||||||
|
@ -161,7 +161,6 @@ export default class MusicList {
|
|||||||
return console.error('暂停播放:音乐播放器不是播放状态!')
|
return console.error('暂停播放:音乐播放器不是播放状态!')
|
||||||
}
|
}
|
||||||
this.audio.pause()
|
this.audio.pause()
|
||||||
this.audio.src = ''
|
|
||||||
this.event.onstop(this.playing)
|
this.event.onstop(this.playing)
|
||||||
this.playing = null
|
this.playing = null
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user