|
@@ -574,7 +574,15 @@ Negotiator._setupListeners = function(connection, pc, pc_id) {
|
|
pc.onaddstream = function(evt) {
|
|
pc.onaddstream = function(evt) {
|
|
util.log('Received remote stream');
|
|
util.log('Received remote stream');
|
|
var stream = evt.stream;
|
|
var stream = evt.stream;
|
|
- provider.getConnection(peerId, connectionId).addStream(stream);
|
|
|
|
|
|
+ var connection = provider.getConnection(peerId, connectionId);
|
|
|
|
+ // 10/10/2014: looks like in Chrome 38, onaddstream is triggered after
|
|
|
|
+ // setting the remote description. Our connection object in these cases
|
|
|
|
+ // is actually a DATA connection, so addStream fails.
|
|
|
|
+ // TODO: This is hopefully just a temporary fix. We should try to
|
|
|
|
+ // understand why this is happening.
|
|
|
|
+ if (connection.type === 'media') {
|
|
|
|
+ connection.addStream(stream);
|
|
|
|
+ }
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|