Michelle Bu 11 年之前
父節點
當前提交
602db8de7c
共有 3 個文件被更改,包括 14 次插入6 次删除
  1. 7 3
      dist/peer.js
  2. 0 0
      dist/peer.min.js
  3. 7 3
      lib/negotiator.js

+ 7 - 3
dist/peer.js

@@ -2217,9 +2217,13 @@ Negotiator.handleSDP = function(type, connection, sdp) {
 }
 
 /** Handle a candidate. */
-Negotiator.handleCandidate = function(connection, candidate) {
-  var candidate = new RTCIceCandidate(candidate);
-  connection.pc.addIceCandidate(candidate);
+Negotiator.handleCandidate = function(connection, ice) {
+  var candidate = ice.candidate;
+  var sdpMLineIndex = ice.sdpMLineIndex;
+  connection.pc.addIceCandidate(new RTCIceCandidate({
+    sdpMLineIndex: sdpMLineIndex,
+    candidate: candidate
+  }));
   util.log('Added ICE candidate for:', connection.peer);
 }
 /**

文件差異過大導致無法顯示
+ 0 - 0
dist/peer.min.js


+ 7 - 3
lib/negotiator.js

@@ -277,8 +277,12 @@ Negotiator.handleSDP = function(type, connection, sdp) {
 }
 
 /** Handle a candidate. */
-Negotiator.handleCandidate = function(connection, candidate) {
-  var candidate = new RTCIceCandidate(candidate);
-  connection.pc.addIceCandidate(candidate);
+Negotiator.handleCandidate = function(connection, ice) {
+  var candidate = ice.candidate;
+  var sdpMLineIndex = ice.sdpMLineIndex;
+  connection.pc.addIceCandidate(new RTCIceCandidate({
+    sdpMLineIndex: sdpMLineIndex,
+    candidate: candidate
+  }));
   util.log('Added ICE candidate for:', connection.peer);
 }

部分文件因文件數量過多而無法顯示