当前位置:网站首页>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 seventh training assignment
- Using ENSP to do MPLS pseudo wire test
- [pyqt] the cellwidget in tablewidget uses signal and slot mechanism
- 创意信息获2家机构调研:GreatDB 数据库已在9地部署
- [C #] the solution of WinForm operation zoom (blur)
- Add a self incrementing sequence number to the antd table component
- [untitled]
- 测试开发基础,教你做一个完整功能的Web平台之环境准备
- 学习笔记|数据小白使用DataEase制作数据大屏
- Poj1821 fence problem solving Report
猜你喜欢
Web端自动化测试失败的原因
科普达人丨一文弄懂什么是云计算?
[untitled]
[untitled]
Avoid mutating a prop directly since the value will be overwritten whenever the parent component
How to remove addition and subtraction from inputnumber input box
[untitled]
Activity lifecycle
分布式数据库主从配置(MySQL)
Transaction rolled back because it has been marked as rollback-only解决
随机推荐
Force buckle 1002 Find common characters
shardingsphere分库分表示例(逻辑表,真实表,绑定表,广播表,单表)
The database synchronization tool dbsync adds support for mongodb and es
Using ENSP to do MPLS pseudo wire test
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)
在我有限的软件测试经历里,一段专职的自动化测试经验总结
Kitex retry mechanism
[C #] the solution of WinForm operation zoom (blur)
Go redis Middleware
electron 添加 SQLite 数据库
The opacity value becomes 1%
Mpx 插件
Process control (creation, termination, waiting, program replacement)
Go Slice 比较
常用sql语句整理:mysql
关于jmeter中编写shell脚本json的应用
LeetCode - 面试题17.24 最大子矩阵
Array object sorting
Go slice comparison
What if copying is prohibited?