当前位置:网站首页>How to add aplayer music player in blog
How to add aplayer music player in blog
2022-07-07 11:17:00 【InfoQ】
Preface


course
1. Music plug-in
- Official website :https://aplayer.js.org/
- Github:https://github.com/MoePlayer/APlayer/
2. Music resources
- Little white plate :https://www.xiaobaipan.com/
- Magic cube Castle :http://www.mfcb.net/wsyy/
- 23APE:http://www.23ape.net/
- HIFINI:https://www.hifini.com/
3. Implementation code
APlayer.min.js
APlayer.min.css
WordPress
wp-content
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
3.1Mini player
WordPress
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<div id='aplayer'></div>
<script>
var ap = new APlayer
({
element: document.getElementById('aplayer'),
showlrc: false,
fixed: true,
mini: true,
audio: {
title: ' Peninsula iron box ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box -mp3-image.png'
}
});
ap.init();
</script>

audio
<script>
var ap = new APlayer
({
element: document.getElementById('aplayer'),
showlrc: false,
fixed: true,
mini: true,
audio: [
{
title: ' Peninsula iron box ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box -mp3-image.png'
},
{
title: ' Give me a song time ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time -mp3-image.png'
}
]
});
ap.init();
</script>

3.2 Single page music
fixed
mini
false
<link rel="stylesheet" href="https://echeverra.cn/wp-content/APlayer.min.css">
<script src="https://echeverra.cn/wp-content/APlayer.min.js"></script>
<div id='demo'></div>
<script>
var demo = new APlayer
({
element: document.getElementById('demo'),
showlrc: false,
fixed: false,
mini: false,
audio: [
{
title: ' Peninsula iron box ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box -mp3-image.png'
},
{
title: ' Give me a song time ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time -mp3-image.png'
}
]
});
demo.init();
</script>


<div id="apalyer"></div>
id
new
Aplayer
audio
mutex
true
<div id='demo1'></div>
<div id='demo2'></div>
<script>
var demo1 = new APlayer
({
element: document.getElementById('demo1'),
showlrc: false,
audio: {
title: ' Peninsula iron box ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2022/05/ Jay Chou - Peninsula iron box -mp3-image.png'
}
});
var demo2 = new APlayer
({
element: document.getElementById('demo2'),
showlrc: false,
audio: {
title: ' Give me a song time ',
author: ' Jay Chou ',
url: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time .mp3',
pic: 'https://echeverra.cn/wp-content/uploads/2021/06/ Jay Chou - Give me a song time -mp3-image.png'
}
});
demo1.init();
demo2.init();
</script>

<script>
<p>

fixed
mini
true
false
4.Meting Trilateral music
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js"></script>
4.1 Single introduction
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js"></script>
<meting-js server="netease" type="song" id="2526628"></meting-js>
server="netease"
type="song"
id="2526628"

4.2 Song list introduction
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js"></script>
<meting-js server="netease" type="playlist" id="7360465359"></meting-js>

server="netease"
type="playlist"
id="7360465359"
4.3Mini player
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Meting.min.js"></script>
<meting-js
server="netease"
type="playlist"
id="7360465359"
fixed="true"
mini="true"
order="random"
loop="all"
preload="auto"
list-folded="false">
</meting-js>
server、type、id
fixed="true", mini="true"
order="random"

4.4 Blog Garden Music introduction


- Aplayer Official documents
- Aplayer collocation Metingjs Use of music plug-ins
- MetingJS How to cooperate with Aplayer Loading song list
边栏推荐
- The database synchronization tool dbsync adds support for mongodb and es
- 关于jmeter中编写shell脚本json的应用
- Verilog realizes nixie tube display driver [with source code]
- Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)
- V-for img SRC rendering fails
- seata 1.3.0 四種模式解决分布式事務(AT、TCC、SAGA、XA)
- How to use cherry pick?
- Ffmpeg record a video command from RTSP
- [untitled]
- JS add spaces to the string
猜你喜欢
Wallhaven壁纸桌面版
普通测试年薪15w,测试开发年薪30w+,二者差距在哪?
技术分享 | 抓包分析 TCP 协议
Still cannot find RPC dispatcher table failed to connect in virtual KD
Vscode 尝试在目标目录创建文件时发生一个错误:拒绝访问【已解决】
Basic knowledge of process (orphan, zombie process)
IDEA快捷键大全
RationalDMIS2022 高级编程宏程序
Activity生命周期
Shardingsphere sub database and table examples (logical table, real table, binding table, broadcast table, single table)
随机推荐
Activity lifecycle
关于SIoU《SIoU Loss: More Powerful Learning for Bounding Box Regression Zhora Gevorgyan 》的一些看法及代码实现
使用引用
QT implements the delete method of the container
Verilog design responder [with source code]
对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
‘module‘ object is not callable错误
Ffmpeg record a video command from RTSP
Qt|多个窗口共有一个提示框类
'module 'object is not callable error
Go slice comparison
Go redis Middleware
Go Slice 比较
2021-04-08
Android interview knowledge points
MPX plug-in
Android 面试知识点
V-for img SRC rendering fails
关于测试人生的一站式发展建议
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)