naw*_*bgh 10 firefox google-chrome webrtc
我正在为局域网构建聊天应用程序.我使用WebRTC但无法让Firefox和Google Chrome进行互操作.我不知道我应该传递给RTCPeerConnection createOffer/createAnswer的确切参数.
我在同一台计算机Fedora Linux 20 中使用Firefox 31和Google Chrome 36进行了以下测试
RTCPeerConnection创建如下:
pc = new RTCPeerConnection(null, RTC_PC_OPTIONS);
答案/优惠创建如下:
pc.createOffer(onsuccess, onfail, CONSTRAINTS);
我的问题是:我应该通过哪些参数(RTC_PC_OPTIONS和CONSTRAINTS)来获得两个浏览器之间的互操作性?
RTC_PC_OPTIONS = undefined
CONSTRAINTS = undefined
FFx2FFx FFx2Chrome Chrome2FFx Chrome2Chrome
------- ---------- ---------- -------------
dataChannel setup ok ok ok ok
dataChannel send/recv ok ok ok ok
Video stream ok ok err [1] ok
Run Code Online (Sandbox Code Playgroud)
MDN recomands this value for RTC_PC_OPTIONS
RTC_PC_OPTIONS = {
optional: [
{DtlsSrtpKeyAgreement: true},
{RtpDataChannels: true}
]
};
CONSTRAINTS = undefined
FFx2FFx FFx2Chrome Chrome2FFx Chrome2Chrome
------- ---------- ---------- -------------
dataChannel setup ok err [2] err [3] ok
dataChannel send/recv ok - - ok
Video stream ok - - err [4]
^~~~~~~~~~~~~~~~^
^
i used datachannel to do signaling for the video TRCPeerConnection,
that is why these were not tested
Run Code Online (Sandbox Code Playgroud)
RTC_PC_OPTIONS = undefined
CONSTRAINTS = { 'mandatory': { 'OfferToReceiveAudio': true, 'OfferToReceiveVideo': true } }
FFx2FFx FFx2Chrome Chrome2FFx Chrome2Chrome
------- ---------- ---------- -------------
dataChannel setup ok ok ok err [5]
dataChannel send/recv ok ok ok -
Video stream err [6] ok err [6] -
Run Code Online (Sandbox Code Playgroud)
chrome得到答案.但onaddstream并没有在firefox中被触发
Failed to set remote offer sdp: Session error code: ERROR_CONTENT. Session error description: Failed to set data send codecs..
chrome收到此错误: Failed to parse SessionDescription. m=application 35224 RTP/SAVPF Expects at least 4 fields.
FFx收到此错误: ICE failed, see about:webrtc for more details
在about:webrtc:
Local candidate Remote candidate ICE State Priority Nominated Selected
a.b.c.d:35224/udp(host) a.b.c.d:45895/udp(host) frozen 9115005270282354000
Uncaught NetworkError: Failed to execute 'send' on 'RTCDataChannel': Could not send datachrome_2收到错误:
Uncaught SyntaxError: Failed to execute 'addIceCandidate' on 'RTCPeerConnection': The ICE candidate could not be added.
Failed to set remote offer sdp: Session error code: ERROR_CONTENT. Session error description: Failed to set data send codecs.
所以,有一些事情:
尝试使用FF Beta和Nightly(http://nightly.mozilla.org/).当您报告此类内容时,请指出您正在使用的浏览器版本!:-)
| 归档时间: |
|
| 查看次数: |
5080 次 |
| 最近记录: |