javascript - NW.js : Failed to parse SessionDescription. 无法正确解析音频编解码器

标签 javascript google-chrome webrtc node-webkit peerjs

我们正在与 peerjs (Webrtc) 建立视频聊天。我们有一个 nodewebkit 版本和一个 chrome 版本。 但是由于某种原因,如果 chrome 启动一个媒体流到 nodewebkit,我们会在 nw 中得到以下错误。

PeerJS:  Creating RTCPeerConnection.
peer.min.js:1 PeerJS:  Listening for ICE candidates.
peer.min.js:1 PeerJS:  Listening for `negotiationneeded`
peer.min.js:1 PeerJS:  Listening for data channel
peer.min.js:1 PeerJS:  Listening for remote stream
peerJS:  Setting remote description RTCSessionDescription {sdp: "v=0↵o=- 2956768960815374026 2 IN IP4 127.0.0.1↵s…5525 label:87a9904d-945d-4393-ad98-68be98482104↵", type: "offer"}
peer.min.js:1 PeerJS:  ERROR Error: Failed to parse SessionDescription.  Failed to parse audio codecs correctly.
callingManager.js:293 webrtc:Failed to parse SessionDescription.  Failed to parse audio codecs correctly.
peer.min.js:1 PeerJS:  Failed to setRemoteDescription,  Failed to parse SessionDescription.  Failed to parse audio codecs correctly.
8peer.min.js:1 Uncaught SyntaxError: Failed to execute 'addIceCandidate' on 'RTCPeerConnection': The ICE candidate could not be added.

所以错误是:

Error: Failed to parse SessionDescription.  Failed to parse audio codecs correctly.

nodewebkit 到 Chrome 运行良好。

新版本:v0.12.3 Chrome 版本:46

这是媒体 condec 问题吗?任何人都可以帮忙吗? 谢谢!

最佳答案

Chrome 46 将 SDP m 行中的协议(protocol)从“RTP/SAVPF”更改为“UDP/TLS/RTP/SAVPF”。似乎 node-webkit 使用的是一个非常旧的 webrtc 版本(>1 年),无法处理这个问题。

这已经公布了很长一段时间了。见 https://twitter.com/juberti/status/656535175635963904等。

Munge 您的 SDP 并将“UDP/TLS/RTP/SAVPF”替换为“RTP/SAVPF”。

关于javascript - NW.js : Failed to parse SessionDescription. 无法正确解析音频编解码器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33284549/

相关文章:

nginx - 将 nginx rtmp 片段发送到 WebRTC

javascript - 错误 TS2314 : Generic type 'Promise<T>' requires 1 type argument(s)

javascript - meteor 插件不起作用

类的 Javascript .addEventListener "mouseenter"

javascript - 为什么我在运行 changeword.js 时会得到未定义的字样?

google-chrome - Chrome应用内容安全政策问题

html - CSS float 未在 Chrome 中应用...错误或用户错误?

google-chrome - Chrome 卡在带有许多隐藏单选按钮的页面上

javascript - 在 webRTC 调用中设置接收器

google-chrome - 处理chrome的rtp流需要哪些gstreamer管道设置?