【问题标题】:How can I fix "Cannot read property 'srcObject' of undefined" in Freeswitch Verto如何修复 Freeswitch Verto 中的“无法读取未定义的属性‘srcObject’”
【发布时间】:2017-04-15 22:31:09
【问题描述】:

我正在尝试在 Chrome 57.0.2987.133(64 位)中使用 verto。

在关注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,但我得到了(未捕获的TypeError:无法读取未定义的属性'srcObject'和未捕获的TypeError:无法读取未定义的属性'sinkId')在 chrome 控制台中。见下文:

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。

我们将不胜感激

【问题讨论】:

    标签: webrtc freeswitch mod-verto


    【解决方案1】:

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

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

    原来我不得不做这些额外的事情;

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

    解决了。

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

    【讨论】:

      猜你喜欢
      • 2019-12-08
      • 2019-08-19
      • 2021-02-28
      • 2019-11-02
      • 2021-10-03
      • 2021-10-28
      • 2022-01-12
      • 2022-11-22
      • 2021-03-03
      相关资源
      最近更新 更多