Skip to content

Commit 999e649

Browse files
committed
update README
1 parent 4071ae5 commit 999e649

1 file changed

Lines changed: 18 additions & 38 deletions

File tree

README.md

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![npm](https://img.shields.io/npm/v/aplayer.svg?style=flat-square)](https://www.npmjs.com/package/aplayer)
44
[![npm](https://img.shields.io/npm/l/aplayer.svg?style=flat-square)](https://www.npmjs.com/package/aplayer)
5-
65
[![devDependency Status](https://img.shields.io/david/dev/DIYgod/aplayer.svg?style=flat-square)](https://david-dm.org/DIYgod/APlayer#info=devDependencies)
76
[![npm](https://img.shields.io/npm/dt/aplayer.svg?style=flat-square)](https://www.npmjs.com/package/aplayer)
87
[![Travis](https://img.shields.io/travis/DIYgod/APlayer.svg?style=flat-square)](https://travis-ci.org/DIYgod/APlayer)
@@ -22,14 +21,14 @@ Screenshot
2221
## Install
2322

2423
```
25-
npm install aplayer
24+
$ npm install aplayer
2625
```
2726

2827
## Usage
2928

30-
### HTML:
29+
### HTML
3130

32-
```
31+
```HTML
3332
<link rel="stylesheet" href="APlayer.css">
3433
<!-- ... -->
3534
<div id="player1" class="aplayer">
@@ -39,9 +38,9 @@ npm install aplayer
3938
<script src="APlayer.js"></script>
4039
```
4140

42-
### JS:
41+
### JS
4342

44-
```
43+
```JS
4544
var ap = new APlayer({
4645
element: document.getElementById('player1'),
4746
narrow: false,
@@ -57,9 +56,9 @@ var ap = new APlayer({
5756
ap.init();
5857
```
5958

60-
### JS Initialized Options
59+
#### Options
6160

62-
```
61+
```JS
6362
{
6463
element: document.getElementById('player1'), // Optional, player element
6564
narrow: false, // Optional, narrow style
@@ -74,13 +73,19 @@ ap.init();
7473
}
7574
```
7675

76+
#### API
77+
78+
+ `ap.init()`
79+
+ `ap.play()`
80+
+ `ap.pause()`
81+
7782
### With lrc
7883

7984
Using [LRC format](https://en.wikipedia.org/wiki/LRC_(file_format))
8085

8186
HTML:
8287

83-
```
88+
```HTML
8489
<link rel="stylesheet" href="APlayer.css">
8590
<!-- ... -->
8691
<div id="player1" class="aplayer">
@@ -107,18 +112,12 @@ HTML:
107112

108113
JS:
109114

110-
Initialized Option: `showlrc: false`
111-
112-
### API
113-
114-
+ `ap.init()`
115-
+ `ap.play()`
116-
+ `ap.pause()`
115+
Option: `showlrc: false`
117116

118117
### Development
119118

120119
```
121-
gulp
120+
$ gulp
122121
```
123122

124123
## Todo
@@ -136,30 +135,11 @@ gulp
136135
## Issues
137136

138137
- [ ] 在 Firefox 中调整进度后, 播放到最后时音乐总时间会自动变长
139-
- [ ] 移动端各种浏览器触发事件的时机不同: 目前使用 loadedmetadata 代替 canplay
140-
```
141-
举例:
142-
WIFI环境:
143-
iOS: 加载? durationchange(真) loadedmetadata 点击 开始播放 loadeddata canplay canplaythrough
144-
Android Chrome: durationchange(真) loadedmetadata loadeddata canplay canplaythrough 点击 加载 开始播放
145-
Android UC: durationchange loadedmetadata loadeddata 加载 durationchange(真) canplay canplaythrough 点击 开始播放
146-
PC: 加载 开始播放 durationchange(真) loadedmetadata loadeddata canplay canplaythrough
147-
蜂窝环境:
148-
Android Chrome: durationchange loadedmetadata loadeddata canplay canplaythrough 点击 加载 开始播放 durationchange(真)
149-
Android UC: durationchange loadedmetadata loadeddata 点击 加载 开始播放 canplay canplaythrough durationchange(真)
150-
```
138+
- [ ] 移动端各种浏览器触发事件的时机不同
151139
- [ ] 移动版 Safari 和 部分 Android 浏览器不支持 volume
152140
- [ ] 部分 Android 浏览器不支持 duration
153141

154142

155143
## LICENSE
156144

157-
(MIT License)
158-
159-
Copyright (c) DIYgod
160-
161-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
162-
163-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
164-
165-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
145+
MIT © [DIYgod](http://github.com/DIYgod)

0 commit comments

Comments
 (0)