mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/lyswhut/lx-music-desktop.git
synced 2026-09-20 08:04:00 +08:00
修复某些情况下可能出现播放歌曲没有声音的问题 (#2693)
This commit is contained in:
@@ -4,3 +4,4 @@
|
||||
### 修复
|
||||
|
||||
- 修复桌面歌词的 鼠标移入歌词区域时提高透明度 设置不稳定的问题(#2679, @Little100)
|
||||
- 修复某些情况下可能播放没有声音的问题(#2693)
|
||||
|
||||
@@ -65,6 +65,16 @@ export const createAudio = () => {
|
||||
audio.autoplay = true
|
||||
audio.preload = 'auto'
|
||||
audio.crossOrigin = 'anonymous'
|
||||
|
||||
// https://developer.chrome.com/blog/autoplay
|
||||
audio.addEventListener('playing', () => {
|
||||
if (audioContext?.state == 'suspended') {
|
||||
void audioContext.resume().catch((err) => {
|
||||
console.error('Resume audio context failed:', err)
|
||||
throw err
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const initAnalyser = () => {
|
||||
|
||||
Reference in New Issue
Block a user