update README
This commit is contained in:
parent
4071ae5df3
commit
999e649e3c
56
README.md
56
README.md
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
[](https://www.npmjs.com/package/aplayer)
|
||||
[](https://www.npmjs.com/package/aplayer)
|
||||
|
||||
[](https://david-dm.org/DIYgod/APlayer#info=devDependencies)
|
||||
[](https://www.npmjs.com/package/aplayer)
|
||||
[](https://travis-ci.org/DIYgod/APlayer)
|
||||
|
|
@ -22,14 +21,14 @@ Screenshot
|
|||
## Install
|
||||
|
||||
```
|
||||
npm install aplayer
|
||||
$ npm install aplayer
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### HTML:
|
||||
### HTML
|
||||
|
||||
```
|
||||
```HTML
|
||||
<link rel="stylesheet" href="APlayer.css">
|
||||
<!-- ... -->
|
||||
<div id="player1" class="aplayer">
|
||||
|
|
@ -39,9 +38,9 @@ npm install aplayer
|
|||
<script src="APlayer.js"></script>
|
||||
```
|
||||
|
||||
### JS:
|
||||
### JS
|
||||
|
||||
```
|
||||
```JS
|
||||
var ap = new APlayer({
|
||||
element: document.getElementById('player1'),
|
||||
narrow: false,
|
||||
|
|
@ -57,9 +56,9 @@ var ap = new APlayer({
|
|||
ap.init();
|
||||
```
|
||||
|
||||
### JS Initialized Options
|
||||
#### Options
|
||||
|
||||
```
|
||||
```JS
|
||||
{
|
||||
element: document.getElementById('player1'), // Optional, player element
|
||||
narrow: false, // Optional, narrow style
|
||||
|
|
@ -74,13 +73,19 @@ ap.init();
|
|||
}
|
||||
```
|
||||
|
||||
#### API
|
||||
|
||||
+ `ap.init()`
|
||||
+ `ap.play()`
|
||||
+ `ap.pause()`
|
||||
|
||||
### With lrc
|
||||
|
||||
Using [LRC format](https://en.wikipedia.org/wiki/LRC_(file_format))
|
||||
|
||||
HTML:
|
||||
|
||||
```
|
||||
```HTML
|
||||
<link rel="stylesheet" href="APlayer.css">
|
||||
<!-- ... -->
|
||||
<div id="player1" class="aplayer">
|
||||
|
|
@ -107,18 +112,12 @@ HTML:
|
|||
|
||||
JS:
|
||||
|
||||
Initialized Option: `showlrc: false`
|
||||
|
||||
### API
|
||||
|
||||
+ `ap.init()`
|
||||
+ `ap.play()`
|
||||
+ `ap.pause()`
|
||||
Option: `showlrc: false`
|
||||
|
||||
### Development
|
||||
|
||||
```
|
||||
gulp
|
||||
$ gulp
|
||||
```
|
||||
|
||||
## Todo
|
||||
|
|
@ -136,30 +135,11 @@ gulp
|
|||
## Issues
|
||||
|
||||
- [ ] 在 Firefox 中调整进度后, 播放到最后时音乐总时间会自动变长
|
||||
- [ ] 移动端各种浏览器触发事件的时机不同: 目前使用 loadedmetadata 代替 canplay
|
||||
```
|
||||
举例:
|
||||
WIFI环境:
|
||||
iOS: 加载? durationchange(真) loadedmetadata 点击 开始播放 loadeddata canplay canplaythrough
|
||||
Android Chrome: durationchange(真) loadedmetadata loadeddata canplay canplaythrough 点击 加载 开始播放
|
||||
Android UC: durationchange loadedmetadata loadeddata 加载 durationchange(真) canplay canplaythrough 点击 开始播放
|
||||
PC: 加载 开始播放 durationchange(真) loadedmetadata loadeddata canplay canplaythrough
|
||||
蜂窝环境:
|
||||
Android Chrome: durationchange loadedmetadata loadeddata canplay canplaythrough 点击 加载 开始播放 durationchange(真)
|
||||
Android UC: durationchange loadedmetadata loadeddata 点击 加载 开始播放 canplay canplaythrough durationchange(真)
|
||||
```
|
||||
- [ ] 移动端各种浏览器触发事件的时机不同
|
||||
- [ ] 移动版 Safari 和 部分 Android 浏览器不支持 volume
|
||||
- [ ] 部分 Android 浏览器不支持 duration
|
||||
|
||||
|
||||
## LICENSE
|
||||
|
||||
(MIT License)
|
||||
|
||||
Copyright (c) DIYgod
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
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.
|
||||
MIT © [DIYgod](http://github.com/DIYgod)
|
||||
Loading…
Reference in New Issue