webrtc - 如何修复 "Cannot read property ' srcObject' of undefined"in Freeswitch Verto

标签 webrtc freeswitch mod-verto

我正在尝试让 verto 在 Chrome 57.0.2987.133(64 位)中运行。

关注https://dopensource.com/2017/01/21/setting-up-freeswitch-webrtc-functionality/之后,我能够让 webrtc/verto 在服务器上工作。我能够获得演示应用程序(在 verto 存储库中)来连接和调用电话。

我关注了http://evoluxbr.github.io/verto-docs/tut/making-a-call.html在我这边设置 verto,但我在 chrome 控制台中得到(Uncaught TypeError: Cannot read property 'srcObject' of undefined and Uncaught TypeError: Cannot read property 'sinkId' of undefined)。见下文:

Uncaught TypeError: Cannot read property 'srcObject' of undefined
    at FSRTCattachMediaStream (jquery.FSRTC.js:236)
    at onRemoteStream (jquery.FSRTC.js:255)
    at Object.self.peer.FSRTCPeerConnection.onRemoteStream (jquery.FSRTC.js:593)
    at RTCPeerConnection.FSRTCPeerConnection.peer.onaddstream (jquery.FSRTC.js:737)
Uncaught TypeError: Cannot read property 'sinkId' of undefined
    at $.verto.dialog.setAudioPlaybackDevice (jquery.verto.js:2144)
    at jquery.verto.js:2214

https://pastebin.com/j4GrER0Q . 我的脚本导入看起来像 https://pastebin.com/H55piU1r .

我们将不胜感激

最佳答案

所以,我最终弄明白了这一点。自 http://evoluxbr.github.io/verto-docs/ 以来,verto 代码库已更改被提出。

我克隆了最新的(48 小时前)FS 存储库以获取 verto js 库。

原来我必须做这些额外的事情;

  1. 将 vendor/adapter-latest.js 包含在您的 index.html 中的 verto 库之前(或任何名称)
  2. 在新的 verto 配置中,添加 tag: "<whatever>",
  3. 插入 <video id="<whatever>"></video>在你的 index.html 中。您可以添加 display: none;隐藏视频 - 如果您只需要音频。

那就解决了。

更新:如果您只需要音频,那么只需使用 <audio>标签。

关于webrtc - 如何修复 "Cannot read property ' srcObject' of undefined"in Freeswitch Verto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43431919/

相关文章:

python - 如何摆脱无法杀死的 Freeswitch channel

audio - 在 Freeswitch 中停止播放

webrtc - FreeSWITCH:无法从企业防火墙后面的浏览器(WebRTC)进行连接

ios - WebRTC + IOS + Freeswitch : Can't hear audio

javascript - WEBRTC - 无需任何扩展的屏幕共享

javascript - 有什么方法可以知道用户是否接到电话? (Javascript)

ios - 使用分辨率设置为 480x640 的 iOS AppRTCDemo 进行调用

javascript - 通过 RTC 数据通道发送图像数据