DEBUG
This commit is contained in:
parent
3d9160a225
commit
d973619718
@ -117,9 +117,9 @@
|
||||
const chunkNumber = Math.ceil(item.size / 1024 / 64) // 64KB每片
|
||||
clientList.setChannel(`music-data-${item.id}`, {
|
||||
onmessage: async (event, client) => {
|
||||
console.log('收到音乐数据 chunk', `${count+1}/${chunkNumber}`, buffer.byteLength)
|
||||
console.log('收到音乐数据 chunk', `${count + 1}/${chunkNumber}`, buffer.byteLength)
|
||||
buffer = appendBuffer(buffer, event.data) // 合并分片准备存储
|
||||
item.arrayBufferChunks.push(event.data) // 保存分片给边下边播
|
||||
item.arrayBufferChunks?.push(event.data) // 保存分片给边下边播
|
||||
count++
|
||||
if (buffer.byteLength >= item.size) {
|
||||
console.log('音乐数据接收完毕')
|
||||
|
@ -171,7 +171,7 @@ export default class MusicList {
|
||||
await new Promise(resolve => setTimeout(resolve, 200))
|
||||
continue
|
||||
}
|
||||
console.log('播放器加载分片:', item.name, `${index+1}/${chunkNumber}`)
|
||||
console.log('播放器加载分片:', item.name, `${index + 1}/${chunkNumber}`)
|
||||
const chunk = item.arrayBufferChunks[index] // 顺序取出一个arrayBuffer分片
|
||||
sourceBuffer.appendBuffer(chunk) // 添加到sourceBuffer
|
||||
index++
|
||||
|
Loading…
Reference in New Issue
Block a user