mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-25 00:37:24 +08:00
small fix
This commit is contained in:
@@ -612,19 +612,23 @@ class AudioService {
|
|||||||
if (seekTime > 0) {
|
if (seekTime > 0) {
|
||||||
this.currentSound.seek(seekTime);
|
this.currentSound.seek(seekTime);
|
||||||
}
|
}
|
||||||
console.log('audioService: 音频加载成功,设置 EQ');
|
console.log('audioService: 音频加载成功,设置 EQ');
|
||||||
this.updateMediaSessionMetadata(track);
|
this.updateMediaSessionMetadata(track);
|
||||||
this.updateMediaSessionPositionState();
|
this.updateMediaSessionPositionState();
|
||||||
this.emit('load');
|
this.emit('load');
|
||||||
|
|
||||||
// 此时音频已完全初始化,根据 isPlay 参数决定是否播放
|
// 此时音频已完全初始化,根据 isPlay 参数决定是否播放
|
||||||
console.log('audioService: 音频完全初始化,isPlay =', isPlay);
|
console.log('audioService: 音频完全初始化,isPlay =', isPlay);
|
||||||
if (isPlay) {
|
if (isPlay) {
|
||||||
console.log('audioService: 开始播放');
|
console.log('audioService: 开始播放');
|
||||||
this.currentSound.play();
|
this.currentSound.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(this.currentSound);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Audio initialization failed:', error);
|
||||||
|
reject(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(this.currentSound);
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Audio initialization failed:', error);
|
console.error('Audio initialization failed:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user