From dc34eeda6efe90ee863465d71b881eb5c96adde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=89?= Date: Sun, 8 Oct 2023 00:17:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9m4a=E7=B1=BB=E5=9E=8B=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=AE=8C=E6=89=8D=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/client.js | 4 ++-- public/music.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/client.js b/public/client.js index 20c9ff7..453f9fb 100644 --- a/public/client.js +++ b/public/client.js @@ -215,7 +215,7 @@ export default class ClientList { }, children: [ Avatar({ - src: item.avatar || '/favicon.ico', + src: item.avatar ?? '/favicon.ico', style: { width: '32px', height: '32px', @@ -230,7 +230,7 @@ export default class ClientList { onclick: event => document.body.appendChild(Dialog({ children: [ Avatar({ - src: item.avatar || '/favicon.ico', + src: item.avatar ?? '/favicon.ico', style: { width: '240px', height: '240px', diff --git a/public/music.js b/public/music.js index f4199d0..13618d3 100644 --- a/public/music.js +++ b/public/music.js @@ -140,8 +140,9 @@ export default class MusicList { } async play(item) { if (!item.arrayBuffer) { - // 不支持流式加载wav和flac, 需要全部加载完毕才能播放 - if (item.type === 'audio/wav' || item.type === 'audio/flac') { + console.log('加载音乐类型:', item.type) + // 不支持流式加载wav和flac和m4a, 需要全部加载完毕才能播放 + if (item.type === 'audio/wav' || item.type === 'audio/flac' || item.type === 'audio/x-m4a') { await this.load(item) this.audio.src = URL.createObjectURL(new Blob([item.arrayBuffer], { type: item.type })) this.audio.play()