Warning: is_readable(): open_basedir restriction in effect. File(/gitinfo/info.json) is not within the allowed path(s): (/www/wwwroot/wiki.guguwo.top/:/tmp/) in /www/wwwroot/wiki.guguwo.top/includes/utils/GitInfo.php on line 177
模板:APlayer - 咕咕窝wiki

模板:APlayer

来自咕咕窝wiki
卡介菌讨论 | 贡献2025年3月16日 (日) 06:05的版本

模板:Documentation

<script> (function() {

 // 确保APlayer加载完成
 function initAPlayer() {
   if (typeof APlayer === 'undefined') {
     setTimeout(initAPlayer, 100);
     return;
   }
   // 解析歌曲参数
   var songs = [];
   {{#forargs: song
     | 
     | {{#if: {{#pos:{{#var:key}}|song}}
         | songs.push({
             name: "{{#explode:{{#var:value}}|;|0}}",
             artist: "{{#explode:{{#var:value}}|;|1}}",
             url: "{{#explode:{{#var:value}}|;|2}}",
             cover: "{{#explode:{{#var:value}}|;|3|https://placehold.co/80x80?text=No+Cover}}"
           });
       }}
   }}
   // 初始化播放器
   new APlayer({
     container: document.getElementById('aplayer-default'),
     audio: songs,
     lrcType: 0,
     fixed: false,
     mini: false,
     theme: '#2980b9'
   });
 }
 // 等待DOM加载完成后执行
 document.addEventListener('DOMContentLoaded', initAPlayer);

})(); </script>