当前位置:网站首页>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
边栏推荐
- Apprentissage comparatif non supervisé des caractéristiques visuelles par les assignations de groupes de contrôle
- Idea shortcut keys
- 通过 Play Integrity API 的 nonce 字段提高应用安全性
- [untitled]
- Unsupervised learning of visual features by contracting cluster assignments
- The fifth training assignment
- Ffmpeg record a video command from RTSP
- The use of list and Its Simulation Implementation
- 学习笔记|数据小白使用DataEase制作数据大屏
- 关于测试人生的一站式发展建议
猜你喜欢
JS add spaces to the string
MPX plug-in
2021-05-21
Verilog 实现数码管显视驱动【附源码】
[STM32] actual combat 3.1 - drive 42 stepper motors with STM32 and tb6600 drivers (I)
uniCloud
Table replication in PostgreSQL
如何在博客中添加Aplayer音乐播放器
对比学习之 Unsupervised Learning of Visual Features by Contrasting Cluster Assignments
IDEA快捷键大全
随机推荐
uniCloud
Go slice comparison
MIF file format record
TDengine 社区问题双周精选 | 第二期
基于DE2 115开发板驱动HC_SR04超声波测距模块【附源码】
From pornographic live broadcast to live broadcast E-commerce
基于Retrofit框架的金山API翻译功能案例
verilog设计抢答器【附源码】
MPX plug-in
Vuthink proper installation process
Activity lifecycle
Eth trunk link switching delay is too high
Apprentissage comparatif non supervisé des caractéristiques visuelles par les assignations de groupes de contrôle
2021-04-08
【C#】WinForm运行缩放(变糊)的解决方法
Interprocess communication (IPC)
Poj1821 fence problem solving Report
Android 面试知识点
Input type= "password" how to solve the problem of password automatically brought in
2021-04-23