无编辑摘要 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
<div id="aplayer-{{#var:id}}" class="aplayer"></div> | |||
<div id="aplayer-{{ | |||
<script> | <script> | ||
(function() { | (function() { | ||
var ap = new APlayer({ | |||
container: document.getElementById('aplayer-{{#var:id}}'), | |||
theme: '{{#var:theme | #f5f5f5}}', // 默认主题 | |||
loop: '{{#var:loop | all}}', // 默认循环播放 | |||
preload: '{{#var:preload | auto}}', // 默认自动预加载 | |||
volume: {{#var:volume | 0.7}}, // 默认音量 | |||
mutex: true, // 互斥播放 | |||
listFolded: {{#var:listFolded | false}}, // 默认不折叠列表 | |||
listMaxHeight: '{{#var:listMaxHeight | 300px}}', // 列表最大高度 | |||
audio: [ | |||
{{#forargs:song|index|value| | |||
{ | |||
name: '{{#var:song{{index}}_name}}', | |||
artist: '{{#var:song{{index}}_artist}}', | |||
url: '{{#var:song{{index}}_url}}', | |||
cover: '{{#var:song{{index}}_cover}}', | |||
}, | |||
}} | |||
] | |||
}); | }); | ||
// Widgets 集成 (如果需要) | |||
if (window.Widget) { | |||
Widget.instance.registerAPlayer(ap); | |||
} | |||
})(); | })(); | ||
</script> | </script> | ||
<noinclude> | |||
{{Documentation}} | |||
</noinclude> | |||
2025年3月16日 (日) 06:21的版本
<script> (function() {
var ap = new APlayer({
container: document.getElementById('aplayer-{{#var:id}}'),
theme: '{{#var:theme | #f5f5f5}}', // 默认主题
loop: '{{#var:loop | all}}', // 默认循环播放
preload: '{{#var:preload | auto}}', // 默认自动预加载
volume: {{#var:volume | 0.7}}, // 默认音量
mutex: true, // 互斥播放
listFolded: {{#var:listFolded | false}}, // 默认不折叠列表
listMaxHeight: '{{#var:listMaxHeight | 300px}}', // 列表最大高度
audio: [
{{#forargs:song|index|value|
{
name: '{{#var:song模板:Index_name}}',
artist: '{{#var:song模板:Index_artist}}',
url: '{{#var:song模板:Index_url}}',
cover: '{{#var:song模板:Index_cover}}',
},
}}
]
});
// Widgets 集成 (如果需要)
if (window.Widget) {
Widget.instance.registerAPlayer(ap);
}
})(); </script>