防止加载不存在的封面
This commit is contained in:
parent
253a4b7134
commit
a232ece058
@ -379,8 +379,10 @@ export default class MusicList {
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.标题.textContent = item.name // 替换标题
|
||||
this.封面.style.backgroundImage = `url(${item.picture})` // 替换封面图像
|
||||
this.标题.textContent = item.name
|
||||
if (item.picture) {
|
||||
this.封面.style.backgroundImage = `url(${item.picture})`
|
||||
}
|
||||
// 替换浏览器媒体信息(使系统通知栏显示歌曲信息)
|
||||
if ('mediaSession' in navigator) {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
|
Loading…
Reference in New Issue
Block a user