MCPcopy Index your code
hub / github.com/modelscope/FunASR / codeFail

Function codeFail

runtime/html5/static/recorder-core.js:727–744  ·  view source on GitHub ↗
(code,msg)

Source from the content-addressed store, hash-verified

725
726 //***********打开麦克风得到全局的音频流************
727 var codeFail=function(code,msg){
728 try{//跨域的优先检测一下
729 window.top.a;
730 }catch(e){
731 failCall('无权录音(跨域,请尝试给iframe添加麦克风访问策略,如allow="camera;microphone")');
732 return;
733 };
734
735 if(/Permission|Allow/i.test(code)){
736 failCall("用户拒绝了录音权限",true);
737 }else if(window.isSecureContext===false){
738 failCall("浏览器禁止不安全页面录音,可开启https解决");
739 }else if(/Found/i.test(code)){//可能是非安全环境导致的没有设备
740 failCall(msg+",无可用麦克风");
741 }else{
742 failCall(msg);
743 };
744 };
745
746
747 //如果已打开并且有效就不要再打开了

Callers 2

recorder-core.jsFile · 0.70
f2Function · 0.70

Calls 1

failCallFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…