我试图将 vidyo.io 集成到我的 Angular Web 应用程序中。在执行此操作时,我正在尝试使用以下方式加载 Vidyo SDK,
script.type = 'text/javascript';
script.src = 'https://static.vidyo.io/4.1.12.8/javascript/VidyoClient/VidyoClient.jsonload=onVidyoClientLoaded';
在名为 的回调方法上onVidyoClientLoaded
,放置了以下开关盒,
switch (status.state) {
case "READY": // The library is operating normally
console.log("Ready");
break;
case "RETRYING": // The library operating is temporarily paused
console.log("Temporarily unavailable");
break;
case "FAILED": // The library operating has stopped
console.log("Failed");
break;
case "FAILEDVERSION": // The library operating has stopped
console.log("Failed version");
break;
case "NOTAVAILABLE": // The library is not available
console.log("Not available");
break;
case "TIMEDOUT":
console.log("Time out");
break;
}
现在,在运行我的 Angular 项目之后,使用ng serve --host 0.0.0.0
,如果我将 url 打为http://localhost:4200
,则“READY”案例被击中。但是,如果我将 url 设为http://192.168.X.X:4200
,则“NOTAVAILABLE”案例会受到打击。
我无法理解为什么会这样。请帮忙。提前致谢。