addAplayerByHexo

Aplayer

Href: https://github.com/DIYgod/APlayer
Document: https://aplayer.js.org/#/zh-Hans/
Hexo-Aplayer: https://github.com/MoePlayer/hexo-tag-aplayer

Install hexo-tag-aplayer

npm install hexo-tag-aplayer --save

Import CDN

cdn:
css:
aplayer: https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css
js:
aplayer: https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.js
meting: https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js

Use

.md

{% meting "2800911035" "netease" "playlist" "autoplay" "mutex:true" "listmaxheight:340px" "preload:auto" "theme:#00c4b6"%}

ๅ…ทไฝ“ๅ‚ๆ•ฐ่ฏฆ่งๅฎ˜ๆ–นๆ–‡ๆกฃ

.pug

Pug Document

Href: https://pug.bootcss.com/

aplayer.pug

doctype html
link(rel='stylesheet', type='text/css', href='https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css')
script(type='text/javascript', src='https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.js')
#aplayer
script(type='text/javascript').
const ap = new APlayer({
container: document.getElementById('aplayer'),
fixed: false,
mini: false,
autoplay: false,
theme: '#00c4b6',
loop: 'all',
order: 'list',
preload: 'none',
volume: 0.7,
mutex: true,
listFolded: false,
listMaxHeight: 90,
lrcType: 1,
audio: [
{
name: 'xxx',
artist: 'xxx',
url: 'xxx.mp3',
cover: 'xxx.jpg?param=300x300',
lrc: 'string',
theme: '#00c4b6'
},
]
});
// ap.init();

ๅœจ้œ€่ฆๅฑ•็คบ็š„ๅœฐๆ–นๅŒ…ๅซ๏ผš

include ./includes/aplayer.pug

Personal Configure

ๆ นๆฎๅฎ˜ๆ–นๆ–‡ๆกฃๅ‚ๆ•ฐๆŒ‡ๅ—ไธชๆ€งๅŒ–้…็ฝฎ

Author: ๐“ฃ๐“ช๐“ญ๐“ถ
Link: https://liuhongwei3.github.io/2020/01/13/addAplayerByHexo/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.