aplayer-给博文添加音乐

aplayer的安装和配置

安装aplayer

在博客目录下运行

1
$ npm install hexo-tag-aplayer --save

用法

1
{% aplayer title author url [picture_url, narrow, autoplay, width:xxx, lrc:xxx] %}

选项介绍

  • title: 音乐标题
  • author: 音乐作者
  • url: 音乐文件的url
  • picture_url: 可选项,音乐图片的url
  • narrow: 可选项,设置为小型的风格
  • autoplay:可选项,设置自动播放
  • width: 可选项,设置播放器ui的宽度,默认是100%
  • lrc: 可选项,设置歌词

关于资源文件的存放和配置,请查阅官方文档

配置例子:

1
{% aplayer "Minecraft" "C418" "Minecraft.mp3" "Minecraft.jpg" "lrc:Minecraft.txt" %}


        

单独配置歌词

用aplayerlrc显示歌词。

1
2
3
{% aplayerlrc "title" "author" "url" "autoplay" %}
[00:00.00]lrc here
{% endaplayerlrc %}

播放列表配置

用aplayerlist配置播放列表。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{% aplayerlist %}
{
"narrow": false, // 可选项,小窗风格
"autoplay": true, // 可选项, 自动播放歌曲,不支持手机浏览器
"mode": "random", // 可选项,播放模式选择,值参: `random` `single` `circulation`(loop) `order`(no loop), 默认: `circulation`
"showlrc": 3, // 可选项, 显示歌词, 有 1, 2, 3
"mutex": true, // 可选项, 只允许播放一首歌
"theme": "#e6d0b2", // 可选项, 设置颜色, 默认: #b7daff
"preload": "metadata", // 可选项, 加载歌曲的方式, 值参: 'none' 'metadata' 'auto', 默认: 'auto'
"listmaxheight": "600px", // 可选项, 播放列表的最大高度
"music": [
{
"title": "Music1",
"author": "Author1",
"url": "Music1.mp3",
"pic": "Music1.jpeg",
"lrc": "Music1.txt"
},
{
"title": "Music2",
"author": "Author2",
"url": "Music2.mp3",
"pic": "Music2.jpg"
}
]
}
{% endaplayerlist %}

v

更多

Windows数据类型 基本数据类型 说明
CHAR char
BYTE unsigned char
BOOL int 布尔类型,TRUE & FALSE
INT int
LONG long 32位长整型
WORD unsigned short 16位字类型
DWORD unsigned long
LPARAM long 64位消息参数类型
WPARAM unsigned int 64位消息参数类型
LPCSTR const char* 字符串常量指针类型
LPSTR char* 字符串指针类型
LPVOID void* 空指针
LRESULT long 32位消息处理结果类型
SHORT short 16位短整型
UINT unsigned int 32位无符号整型
WCHAR unsigned short 16位宽字符类型

|COLORREF|DWORD

0%