Skip to content

Commit

Permalink
更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed Sep 6, 2019
1 parent 104effb commit c92cd3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ set={


### 【方法】rec.close(success)
关闭释放录音资源,浏览器或设备的系统将停止正在录音的提示,释放完成后会调用`success()`回调
关闭释放录音资源,释放完成后会调用`success()`回调

注意:如果创建了多个Recorder对象并且调用了open(应避免同时有多个对象进行了open),只有最后一个新建的才有权限进行实际的资源释放(和多个对象close调用顺序无关),浏览器或设备的系统才会不再显示正在录音的提示。

### 【方法】rec.start()
开始录音,需先调用`open`;如果不支持、错误,不会有任何提示,因为stop时自然能得到错误。
Expand Down
6 changes: 5 additions & 1 deletion assets/zdemo.index.webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,12 @@ function webrtcCloseClick(){
};


var rtcMsgTime=function(){
var d=new Date();
return '<span style="font-size:12px;background:rgba(0,53,255,0.2);">'+("0"+d.getMinutes()).substr(-2)+"′"+("0"+d.getSeconds()).substr(-2)+"</span>";
};
var rtcMsgView=function(msg,isIn){
$(".webrtcMsgBox").prepend('<div class="'+(isIn?"webrtcMsgIn":"webrtcMsgOut")+'">'+msg.replace(/[<>&]/g,function(a){return "&#"+a.charCodeAt(0)+";"}).replace(/ /g,"&nbsp;").replace(/[\r\n]/g,"<br>")+'</div>');
$(".webrtcMsgBox").prepend('<div class="'+(isIn?"webrtcMsgIn":"webrtcMsgOut")+'">'+rtcMsgTime()+msg.replace(/[<>&]/g,function(a){return "&#"+a.charCodeAt(0)+";"}).replace(/ /g,"&nbsp;").replace(/[\r\n]/g,"<br>")+'</div>');
};
var rtcVoiceView=function(data,isIn){
var id=RandomKey(16);
Expand Down

0 comments on commit c92cd3d

Please sign in to comment.