|
@@ -172,7 +172,9 @@ ConnectionManager.prototype._setupDataChannel = function() {
|
|
|
var label = dc.label;
|
|
|
|
|
|
// This should not be empty.
|
|
|
- var options = self.labels[label] || {};
|
|
|
+ // NOTE: Multiple DCs are currently not configurable in FF. Will have to
|
|
|
+ // come up with reasonable defaults.
|
|
|
+ var options = self.labels[label] || { label: label };
|
|
|
var connection = new DataConnection(self.peer, dc, options);
|
|
|
delete self.labels[label];
|
|
|
|
|
@@ -265,9 +267,7 @@ ConnectionManager.prototype._attachConnectionListeners = function(connection) {
|
|
|
});
|
|
|
connection.on('open', function() {
|
|
|
self._lock = false;
|
|
|
- if (util.browserisms !== 'Firefox') {
|
|
|
- self._processQueue();
|
|
|
- }
|
|
|
+ self._processQueue();
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -366,14 +366,14 @@ ConnectionManager.prototype.connect = function(options) {
|
|
|
this.labels[options.label] = options;
|
|
|
|
|
|
var dc;
|
|
|
- if (!!this.pc && !this._lock && util.browserisms !== 'Firefox') {
|
|
|
+ if (!!this.pc && !this._lock && (util.browserisms !== 'Firefox' || Object.keys(this.connections).length !== 0)) {
|
|
|
dc = this.pc.createDataChannel(options.label, { reliable: false });
|
|
|
}
|
|
|
var connection = new DataConnection(this.peer, dc, options);
|
|
|
this._attachConnectionListeners(connection);
|
|
|
this.connections[options.label] = connection;
|
|
|
|
|
|
- if (!this.pc || this._lock || util.browserisms === 'Firefox') {
|
|
|
+ if (!dc) {
|
|
|
this._queued.push(connection);
|
|
|
}
|
|
|
|