From af262ab1344f7d5431c3f2597a94f11a5280b263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=B9=BE?= Date: Wed, 25 Feb 2026 16:13:52 +0800 Subject: [PATCH] =?UTF-8?q?UI=E6=8E=A7=E5=88=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 44706aa..04f9775 100644 --- a/src/main.js +++ b/src/main.js @@ -299,7 +299,8 @@ class AudioPlayer { this.connectAudioSource(); // 等待音频数据加载完成后播放 - const tryAutoPlay = () => { + const tryAutoPlay = (e) => { + console.log('尝试自动播放', e); if (this.audio.readyState >= 2 && (!this.audio.paused || this.shouldAutoPlay)) { this.play(); } @@ -1102,7 +1103,7 @@ class AudioPlayer { checkUrlParams() { // 获取URL参数 const urlParams = new URLSearchParams(window.location.search); - let filePath = urlParams.get('filePath'); + let filePath = urlParams.get('filePath') || ''; let fileName = urlParams.get('fileName') || '网络音乐'; try { @@ -1115,7 +1116,7 @@ class AudioPlayer { } catch (e) { } - if (filePath) { + if (filePath && filePath != '') { this.loadNetworkMusic(filePath, fileName); } }