|
@@ -31,6 +31,10 @@ function DataConnection(peer, provider, options) {
|
|
|
// For storing large data.
|
|
|
this._chunkedData = {};
|
|
|
|
|
|
+ if (this.options._payload) {
|
|
|
+ this._peerBrowser = this.options._payload.browser;
|
|
|
+ }
|
|
|
+
|
|
|
Negotiator.startConnection(
|
|
|
this,
|
|
|
this.options._payload || {
|
|
@@ -161,7 +165,10 @@ DataConnection.prototype.send = function(data, chunked) {
|
|
|
} else if (this.serialization === 'binary' || this.serialization === 'binary-utf8') {
|
|
|
var blob = util.pack(data);
|
|
|
|
|
|
- if (util.browser !== 'Firefox' && !chunked && blob.size > util.chunkedMTU) {
|
|
|
+ // For Chrome-Firefox interoperability, we need to make Firefox "chunk"
|
|
|
+ // the data it sends out.
|
|
|
+ var needsChunking = util.chunkedBrowsers[this._peerBrowser] || util.chunkedBrowsers[util.browser];
|
|
|
+ if (needsChunking && !chunked && blob.size > util.chunkedMTU) {
|
|
|
this._sendChunks(blob);
|
|
|
return;
|
|
|
}
|
|
@@ -238,6 +245,8 @@ DataConnection.prototype.handleMessage = function(message) {
|
|
|
|
|
|
switch (message.type) {
|
|
|
case 'ANSWER':
|
|
|
+ this._peerBrowser = payload.browser;
|
|
|
+
|
|
|
// Forward to negotiator
|
|
|
Negotiator.handleSDP(message.type, this, payload.sdp);
|
|
|
break;
|