如何修复 Freeswitch Verto 中的“无法读取未定义的属性‘srcObject’”

Day*_*ayo 2 freeswitch webrtc 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,但我得到了(Uncaught TypeError: Cannot read property 'srcObject' of undefined and Uncaught TypeError : 无法在 Chrome 控制台中读取 undefined 的属性“sinkId”。见下文:

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
Run Code Online (Sandbox Code Playgroud)

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

将不胜感激

Day*_*ayo 7

所以,我最终想通了这一点。自http://evoluxbr.github.io/verto-docs/ 发布以来,verto 代码库发生了变化。

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

结果我不得不做这些额外的事情;

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

那解决了它。

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