Explorar el Código

Simplest fix to "pc is undefined" on Firefox.

Alberto Torres hace 7 años
padre
commit
8147cfbe3e
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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') {