(stream)
| 756 | |
| 757 | //请求权限,如果从未授权,一般浏览器会弹出权限请求弹框 |
| 758 | var f1=function(stream){ |
| 759 | //https://github.com/xiangyuecn/Recorder/issues/14 获取到的track.readyState!="live",刚刚回调时可能是正常的,但过一下可能就被关掉了,原因不明。延迟一下保证真异步。对正常浏览器不影响 |
| 760 | setTimeout(function(){ |
| 761 | stream._call={}; |
| 762 | var oldStream=Recorder.Stream; |
| 763 | if(oldStream){ |
| 764 | Disconnect(); //直接断开已存在的,旧的Connect未完成会自动终止 |
| 765 | stream._call=oldStream._call; |
| 766 | }; |
| 767 | Recorder.Stream=stream; |
| 768 | if(lockFail())return; |
| 769 | |
| 770 | if(Recorder.IsOpen()){ |
| 771 | if(oldStream)This.CLog("发现同时多次调用open",1); |
| 772 | |
| 773 | Connect(streamStore,1); |
| 774 | ok(); |
| 775 | }else{ |
| 776 | failCall("录音功能无效:无音频流"); |
| 777 | }; |
| 778 | },100); |
| 779 | }; |
| 780 | var f2=function(e){ |
| 781 | var code=e.name||e.message||e.code+":"+e; |
| 782 | This.CLog("请求录音权限错误",1,e); |
nothing calls this directly
no test coverage detected