最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

Webrtc:无法处理WebRTC答案

IT培训 admin 4浏览 0评论

Webrtc:无法处理WebRTC答案

我使用ejabberd + stanza io构建实时消息和音频呼叫网站。我设法进行了第一次音频通话

from chrome(on PC) -> chrome(on mac) with no errors

当我尝试拨打电话时会出现问题

from chrome(on mac) to firefox(on pc) or vice versa

Chrome浏览器日志显示Could not process WebRTC answer

通过使用chrome://webrtc-internals调试工具我发现setremotedescription失败了错误:

`Failed to set remote answer sdp: Called with SDP without ice-ufrag and ice-pwd`

这就是我用来开始通话的内容:

var session = client.jingle.createMediaSession('full JID');
  session.addStream(localAudio_stream); // getUserMedia stream
  session.start();

我究竟做错了什么? firefox如何成功建立一个调用但是chrome cant(在opera上测试得到相同的结果(失败))

Full JS code

回答如下:

我已经通过在client.js(stanza.io)中包含npm包sdpparser然后再次构建它来解决了这个问题,并且在stanza.io.bundle中调整了PeerConnection.prototype.handleAnswer,如下所示:

var sdp = client.SdpParser.parse(answer.sdp);
sdp.media.forEach(function(media){
  if(media.type === 'video' && media.inactive ) {
    delete media.fingerprint;
    media.port = 0;
  }
});
answer.sdp = client.SdpParser.format(sdp);

这可能不是最好的方法,但它肯定解决了这个问题。

github link of the tweaked stanza.io

Helpful github issue on jingle.js repo

Webrtc:无法处理WebRTC答案

我使用ejabberd + stanza io构建实时消息和音频呼叫网站。我设法进行了第一次音频通话

from chrome(on PC) -> chrome(on mac) with no errors

当我尝试拨打电话时会出现问题

from chrome(on mac) to firefox(on pc) or vice versa

Chrome浏览器日志显示Could not process WebRTC answer

通过使用chrome://webrtc-internals调试工具我发现setremotedescription失败了错误:

`Failed to set remote answer sdp: Called with SDP without ice-ufrag and ice-pwd`

这就是我用来开始通话的内容:

var session = client.jingle.createMediaSession('full JID');
  session.addStream(localAudio_stream); // getUserMedia stream
  session.start();

我究竟做错了什么? firefox如何成功建立一个调用但是chrome cant(在opera上测试得到相同的结果(失败))

Full JS code

回答如下:

我已经通过在client.js(stanza.io)中包含npm包sdpparser然后再次构建它来解决了这个问题,并且在stanza.io.bundle中调整了PeerConnection.prototype.handleAnswer,如下所示:

var sdp = client.SdpParser.parse(answer.sdp);
sdp.media.forEach(function(media){
  if(media.type === 'video' && media.inactive ) {
    delete media.fingerprint;
    media.port = 0;
  }
});
answer.sdp = client.SdpParser.format(sdp);

这可能不是最好的方法,但它肯定解决了这个问题。

github link of the tweaked stanza.io

Helpful github issue on jingle.js repo

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论