Skip to content

Commit

Permalink
扩展<mew-music>组件,可用于自定义侧边栏播放器
Browse files Browse the repository at this point in the history
  • Loading branch information
mjsoftking committed Dec 19, 2024
1 parent 4a3759c commit 49431c2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/js/mew-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion templates/assets/js/mew-custom.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# 许可
Expand Down

0 comments on commit 49431c2

Please sign in to comment.