Skip to content

Commit

Permalink
RecordApp Default保持Stream一次,免得Start时再次发起授权
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Sep 4, 2019
1 parent e805388 commit b2c8ab5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions app-support-sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ IOS其他浏览器||
# :open_book:方法文档

## 【静态方法】RecordApp.RequestPermission(success,fail)
请求录音权限,如果当前环境不支持录音或用户拒绝将调用错误回调调用`RecordApp.Start`前需先至少调用一次此方法。
请求录音权限,如果当前环境不支持录音或用户拒绝将调用错误回调调用`RecordApp.Start`前需先至少调用一次此方法;请求权限后如果不使用了,至少要调用一次`Stop`来清理资源

`success`: `fn()` 有权限时回调

Expand Down Expand Up @@ -200,7 +200,7 @@ IOS-Weixin底层会把从微信素材下载过来的原始音频信息存储在s


## 【静态方法】RecordApp.Stop(success,fail)
结束录音
结束录音和清理资源

`success`: `fn(blob,duration)` 结束录音时回调,`blob:Blob` 录音数据`audio/mp3|wav...`格式,`duration`: `123` 音频持续时间。

Expand Down
12 changes: 7 additions & 5 deletions app-support-sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,16 @@
return;
};

if(!curSet){
call("请先开始录音");
return;
};
var setData=curSet;
curSet=null;

reclog(RecordApp.Current.Key+"正在结束"+setData.type+"...");
if(!setData){
//没有开始?不管,stop清理资源
setData={};
}else{
reclog(RecordApp.Current.Key+"正在结束"+setData.type+"...");
};

RecordApp.Stop(function(blob,time){
endCall("",blob,time);

Expand Down
2 changes: 1 addition & 1 deletion dist/app-support/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b2c8ab5

Please sign in to comment.