hexo插入音频

hexo中插入音频需要用到aplayer 和 dplayer 两个插件实现。

插件项目地址
hexo-tag-aplayer
hexo-tag-dplayer

插件安装

1
2
npm install hexo-tag-aplayer
npm install hexo-tag-dplayer

插入音乐

用法

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

参数

1
2
3
4
5
6
7
8
title :音乐标题
author:音乐作者
url:音乐文件网址
picture_url:可选,音乐图片网址
narrow:可选,窄款式
autoplay:可选,自动播放音乐,不支持移动浏览器
width:xxx:可选,前缀width:,播放器宽度(默认值:100%)
lrc:xxx:可选,前缀lrc:,LRC文件url

单个播放示例

1
{% aplayer "Caffeine" "Jeff Williams" "caffeine.mp3" "picture.jpg" "lrc:caffeine.txt" %}

        

列表播放示例

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",
"showlrc": 1,
"mutex": true,
"theme": "#e6d0b2",
"preload": "metadata",
"listmaxheight": "513px",
"music": [
{
"title": "CoCo",
"author": "Jeff Williams",
"url": "caffeine.mp3",
"pic": "caffeine.jpeg",
"lrc": "caffeine.txt"
},
{
"title": "アイロニ",
"author": "鹿乃",
"url": "irony.mp3",
"pic": "irony.jpg"
}
]
}
{% endaplayerlist %}

插入视频

示例

1
2
3
4
5
6
7
8
9
10
{%
dplayer "url=http://blog.mooom.top/fuckyou.mp4"
"api=http://dplayer.daoapp.io"
"pic=http://p1.music.126.net/8qHI7sEEk3eM2DLitQXFDQ==/765260092953631.jpg?param=130y130"
"id=9E2E3368B56CDBB4"
"loop=yes"
"theme=#FADFA3"
"autoplay=false"
"token=tokendemo"
%}
文章目录
  1. 1. 插件安装
  2. 2. 插入音乐
    1. 2.1. 用法
    2. 2.2. 参数
    3. 2.3. 单个播放示例
    4. 2.4. 列表播放示例
  3. 3. 插入视频
    1. 3.1. 示例
|