搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

WebRTC's CreateOffer appears to have broken the error handling

  • 1 回覆
  • 6 有這個問題
  • 5 次檢視
  • 最近回覆由 cor-el

more options

I had a working implementation of WebRTC, using the Adapter.js pollyfill. It was previously working between Firefox and Chrome but now it appears to have a type error on the error handler. I had it set to use null, which still works in Chrome but Firefox now requires {} for an empty error handler (therefore breaking either Chrome or Firefox depending which I use). And it doesn't seem to work with an actual error handler either!

Example Code:

// Works in Firefox

 pc.createOffer(function(description) {
   console.log(description);
   pc.setLocalDescription(description);
   socket.emit('received_offer', JSON.stringify(description));
 }, {}, mediaConstraints);

// Works in Chrome

 pc.createOffer(function(description) {
   console.log(description);
   pc.setLocalDescription(description);
   socket.emit('received_offer', JSON.stringify(description));
 }, null, mediaConstraints);
I had a working implementation of WebRTC, using the Adapter.js pollyfill. It was previously working between Firefox and Chrome but now it appears to have a type error on the error handler. I had it set to use null, which still works in Chrome but Firefox now requires {} for an empty error handler (therefore breaking either Chrome or Firefox depending which I use). And it doesn't seem to work with an actual error handler either! Example Code: // Works in Firefox pc.createOffer(function(description) { console.log(description); pc.setLocalDescription(description); socket.emit('received_offer', JSON.stringify(description)); }, {}, mediaConstraints); // Works in Chrome pc.createOffer(function(description) { console.log(description); pc.setLocalDescription(description); socket.emit('received_offer', JSON.stringify(description)); }, null, mediaConstraints);

由 ShaneHudson 於 修改

所有回覆 (1)

more options

A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.

The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See also: