扩展<mew-music>组件,可用于自定义侧边栏播放器

This commit is contained in:
j m 2024-12-19 20:34:51 +08:00
parent 4a3759c27c
commit 49431c2470
3 changed files with 8 additions and 3 deletions

View File

@ -71,7 +71,10 @@ document.addEventListener('DOMContentLoaded', () => {
theme: this.getAttribute('theme') || 'var(--theme)',
loop: this.getAttribute('loop') || 'all',
autoplay: this.hasAttribute('autoplay') && this.getAttribute('autoplay') !== 'false',
lrcType: 3,
lrcType: this.getAttribute('lrcType') || 3,
listFolded: this.getAttribute('listFolded') || false,
volume: this.getAttribute('volume') || 0.7,
listMaxHeight: this.getAttribute('listMaxHeight') || 450,
}
if (!('APlayer' in window)) {
if (!MewMusic.prototype.load) {
@ -122,6 +125,8 @@ document.addEventListener('DOMContentLoaded', () => {
cover: this.getAttribute('cover'),
lrc: this.getAttribute('lrc') || (this.options.lrcType = undefined),
}]
} else if (this.hasAttribute('music-list')) {
this.options.audio = JSON.parse(this.getAttribute('music-list'))
} else {
this.innerHTML = '未指定播放的音乐!'
return resolve()

File diff suppressed because one or more lines are too long

View File

@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap
# 版本号
version: 1.3.3.beta5
version: 1.3.3.beta6
# 最低支持的 Halo 版本
require: ">=2.20.0"
# 许可