Skip to content

Commit 21a57fc

Browse files
committed
增加打印,完善文档
1 parent 17af59b commit 21a57fc

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

example/App.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class App extends React.Component {
141141
console.log('%c回调监听,停止播放音频', 'color: #2196f3')
142142
}
143143
recorder.onplayend = () => {
144+
console.log('%c回调监听,音频已经完成播放', 'color: #2196f3')
144145
// 播放结束后,停止绘制canavs
145146
this.stopDrawPlay();
146147
}

site/Recorder/event.md

+50
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,53 @@ recorder.onprogress = function(params) {
3030
}
3131
```
3232

33+
## onplay
34+
35+
> 录音播放开始回调。
36+
37+
```js
38+
recorder.onplay = () => {
39+
console.log('onplay')
40+
}
41+
```
42+
43+
## onpauseplay
44+
45+
> 录音播放暂停回调。
46+
47+
```js
48+
recorder.onpauseplay = () => {
49+
console.log('onpauseplay')
50+
}
51+
```
52+
53+
## onresumeplay
54+
55+
> 录音播放恢复回调。
56+
57+
```js
58+
recorder.onresumeplay = () => {
59+
console.log('onresumeplay')
60+
}
61+
```
62+
63+
## onstopplay
64+
65+
> 录音播放停止回调。
66+
67+
```js
68+
recorder.onstopplay = () => {
69+
console.log('onstopplay')
70+
}
71+
```
72+
73+
## onplayend
74+
75+
> 录音播放完成回调。
76+
77+
```js
78+
recorder.onplayend = () => {
79+
console.log('onplayend')
80+
}
81+
```
82+

0 commit comments

Comments
 (0)