UI控制问题
This commit is contained in:
parent
3ec43d5240
commit
af262ab134
@ -299,7 +299,8 @@ class AudioPlayer {
|
|||||||
this.connectAudioSource();
|
this.connectAudioSource();
|
||||||
|
|
||||||
// 等待音频数据加载完成后播放
|
// 等待音频数据加载完成后播放
|
||||||
const tryAutoPlay = () => {
|
const tryAutoPlay = (e) => {
|
||||||
|
console.log('尝试自动播放', e);
|
||||||
if (this.audio.readyState >= 2 && (!this.audio.paused || this.shouldAutoPlay)) {
|
if (this.audio.readyState >= 2 && (!this.audio.paused || this.shouldAutoPlay)) {
|
||||||
this.play();
|
this.play();
|
||||||
}
|
}
|
||||||
@ -1102,7 +1103,7 @@ class AudioPlayer {
|
|||||||
checkUrlParams() {
|
checkUrlParams() {
|
||||||
// 获取URL参数
|
// 获取URL参数
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
let filePath = urlParams.get('filePath');
|
let filePath = urlParams.get('filePath') || '';
|
||||||
let fileName = urlParams.get('fileName') || '网络音乐';
|
let fileName = urlParams.get('fileName') || '网络音乐';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1115,7 +1116,7 @@ class AudioPlayer {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filePath) {
|
if (filePath && filePath != '') {
|
||||||
this.loadNetworkMusic(filePath, fileName);
|
this.loadNetworkMusic(filePath, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user