소스 검색

Merge pull request #419 from DiThi/master

Simplest fix to "pc is undefined" on Firefox.
Jairo Caro-Accino Viciana 7 년 전
부모
커밋
15e31a3fc2
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      lib/negotiator.js

+ 3 - 2
lib/negotiator.js

@@ -21,13 +21,14 @@ Negotiator._idPrefix = 'pc_';
 Negotiator.startConnection = function(connection, options) {
   var pc = Negotiator._getPeerConnection(connection, options);
 
+  // Set the connection's PC.
+  connection.pc = connection.peerConnection = pc;
+
   if (connection.type === 'media' && options._stream) {
     // Add the stream.
     pc.addStream(options._stream);
   }
 
-  // Set the connection's PC.
-  connection.pc = connection.peerConnection = pc;
   // What do we need to do now?
   if (options.originator) {
     if (connection.type === 'data') {