mirror of https://github.com/jkjoy/sunpeiwen.git
4.5 KiB
4.5 KiB
Requirement
https://github.com/MoePlayer/APlayer
Version | API Status | APlayer |
---|---|---|
1.0.x | Deprecated | |
1.1.x | Compatibility | |
1.2.x | Latest |
CDN
- https://cdn.jsdelivr.net/npm/meting@1.2/dist/Meting.min.js
- https://unpkg.com/meting@1.2/dist/Meting.min.js
Quick Start
<!-- require APlayer -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.js"></script>
<div class="aplayer"
data-id="60198"
data-server="netease"
data-type="playlist">
</div>
<script src="dist/Meting.min.js"></script>
https://music.163.com/#/playlist?id=60198
<div class="aplayer"
data-name="rainymood"
data-artist="rainymood"
data-url="https://rainymood.com/audio1110/0.m4a"
data-cover="https://rainymood.com/i/badge.jpg">
</div>
for self-hosted media
<div class="aplayer"
data-name="广东珠江经济电台"
data-artist="FM97.4"
data-url="http://lhttp.qingting.fm/live/1259/64k.mp3"
data-cover="http://pic.qingting.fm/2015/0209/20150209212831195.jpg!200"
data-fixed="true">
</div>
Fixed mode
Option
option | default | description |
---|---|---|
data-id | require | song id / playlist id / album id / search keyword |
data-server | require | music platform: netease , tencent , kugou , xiami , baidu |
data-type | require | song , playlist , album , search , artist |
data-fixed | false |
enable fixed mode |
data-mini | false |
enable mini mode |
data-autoplay | false |
audio autoplay |
data-theme | #2980b9 |
main color |
data-loop | all |
player loop play, values: 'all', 'one', 'none' |
data-order | list |
player play order, values: 'list', 'random' |
data-preload | auto |
values: 'none', 'metadata', 'auto' |
data-volume | 0.7 |
default volume, notice that player will remember user setting, default volume will not work after user set volume themselves |
data-mutex | true |
prevent to play multiple player at the same time, pause other players when this player start play |
data-lrctype | 0 |
lyric type |
data-listfolded | false |
indicate whether list should folded at first |
data-listmaxheight | 340px |
list max height |
data-storagename | metingjs |
localStorage key that store player setting |
deprecated | Instead data-loop , data-order should be used |
Documentation for APlayer can be found at https://aplayer.js.org/#/home?id=options
Advanced
MetingJS allow you to use self-hosted API, more information about Meting.
<script>
var meting_api='http://example.com/api.php?server=:server&type=:type&id=:id&auth=:auth&r=:r';
</script>
<script src="dist/Meting.min.js"></script>
Author
MetingJS © metowolf, Released under the MIT License.
Blog @meto · GitHub @metowolf · Twitter @metowolf · Telegram Channel @metooooo