new api: notice

This commit is contained in:
DIYgod
2018-03-14 00:02:58 +08:00
parent 1dc058c0c7
commit cf44440907
7 changed files with 105 additions and 47 deletions
+9 -1
View File
@@ -135,7 +135,7 @@ const ap = new APlayer({
+ `ap.pause()`: pause audio
+ `ap.seek(time: number)`: seek to specified time
+ `ap.seek(time: number)`: seek to specified time, the unit of time is second
```js
ap.seek(100);
@@ -188,6 +188,12 @@ const ap = new APlayer({
+ `ap.mode`: return current player mode, 'mini' or 'normal'
+ `ap.notice(text: string, time: number, opacity: number)`: show message, the unit of time is millisecond, the default of time is 2000, the default of opacity is 0.8, setting time to 0 can disable notice autohide.
```js
ap.notice('Amazing player', 2000, 0.8);
```
+ `ap.destroy()`: destroy player
+ `ap.audio`: native audio
@@ -242,6 +248,8 @@ Player events
- addaudio
- removeaudio
- destroy
- notice_show
- notice_hide
## LRC
+9 -1
View File
@@ -136,7 +136,7 @@ const ap = new APlayer({
+ `ap.pause()`: 暂停音频
+ `ap.seek(time: number)`: 跳转到特定时间
+ `ap.seek(time: number)`: 跳转到特定时间,时间的单位为秒
```js
ap.seek(100);
@@ -189,6 +189,12 @@ const ap = new APlayer({
+ `ap.mode`: 返回播放器当前模式,'mini' 或 'normal'
+ `ap.notice(text: string, time: number, opacity: number)`: 显示通知,时间的单位为毫秒,默认时间 2000 毫秒,默认透明度 0.8,设置时间为 0 可以取消通知自动隐藏
```js
ap.notice('Amazing player', 2000, 0.8);
```
+ `ap.destroy()`: 销毁播放器
+ `ap.audio`: 原生 video
@@ -243,6 +249,8 @@ ap.on('ended', function () {
- addaudio
- removeaudio
- destroy
- notice_show
- notice_hide
## 歌词