|
@@ -90,7 +90,8 @@ function TraceablePeerConnection(ice_config, constraints, session) {
|
90
|
90
|
self.ondatachannel(event);
|
91
|
91
|
}
|
92
|
92
|
};
|
93
|
|
- if (!navigator.mozGetUserMedia && this.maxstats) {
|
|
93
|
+ // XXX: do all non-firefox browsers which we support also support this?
|
|
94
|
+ if (!RTCBrowserType.isFirefox() && this.maxstats) {
|
94
|
95
|
this.statsinterval = window.setInterval(function() {
|
95
|
96
|
self.peerconnection.getStats(function(stats) {
|
96
|
97
|
var results = stats.result();
|
|
@@ -138,7 +139,7 @@ if (TraceablePeerConnection.prototype.__defineGetter__ !== undefined) {
|
138
|
139
|
this.trace('getLocalDescription::preTransform', dumpSDP(desc));
|
139
|
140
|
|
140
|
141
|
// if we're running on FF, transform to Plan B first.
|
141
|
|
- if (navigator.mozGetUserMedia) {
|
|
142
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
142
|
143
|
desc = this.interop.toPlanB(desc);
|
143
|
144
|
this.trace('getLocalDescription::postTransform (Plan B)', dumpSDP(desc));
|
144
|
145
|
}
|
|
@@ -149,7 +150,7 @@ if (TraceablePeerConnection.prototype.__defineGetter__ !== undefined) {
|
149
|
150
|
this.trace('getRemoteDescription::preTransform', dumpSDP(desc));
|
150
|
151
|
|
151
|
152
|
// if we're running on FF, transform to Plan B first.
|
152
|
|
- if (navigator.mozGetUserMedia) {
|
|
153
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
153
|
154
|
desc = this.interop.toPlanB(desc);
|
154
|
155
|
this.trace('getRemoteDescription::postTransform (Plan B)', dumpSDP(desc));
|
155
|
156
|
}
|
|
@@ -207,7 +208,7 @@ TraceablePeerConnection.prototype.createDataChannel = function (label, opts) {
|
207
|
208
|
TraceablePeerConnection.prototype.setLocalDescription = function (description, successCallback, failureCallback) {
|
208
|
209
|
this.trace('setLocalDescription::preTransform', dumpSDP(description));
|
209
|
210
|
// if we're running on FF, transform to Plan A first.
|
210
|
|
- if (navigator.mozGetUserMedia) {
|
|
211
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
211
|
212
|
description = this.interop.toUnifiedPlan(description);
|
212
|
213
|
this.trace('setLocalDescription::postTransform (Plan A)', dumpSDP(description));
|
213
|
214
|
}
|
|
@@ -237,7 +238,7 @@ TraceablePeerConnection.prototype.setRemoteDescription = function (description,
|
237
|
238
|
this.trace('setRemoteDescription::postTransform (simulcast)', dumpSDP(description));
|
238
|
239
|
|
239
|
240
|
// if we're running on FF, transform to Plan A first.
|
240
|
|
- if (navigator.mozGetUserMedia) {
|
|
241
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
241
|
242
|
description = this.interop.toUnifiedPlan(description);
|
242
|
243
|
this.trace('setRemoteDescription::postTransform (Plan A)', dumpSDP(description));
|
243
|
244
|
}
|
|
@@ -277,7 +278,7 @@ TraceablePeerConnection.prototype.createOffer = function (successCallback, failu
|
277
|
278
|
// if we're running on FF, transform to Plan B first.
|
278
|
279
|
// NOTE this is not tested because in meet the focus generates the
|
279
|
280
|
// offer.
|
280
|
|
- if (navigator.mozGetUserMedia) {
|
|
281
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
281
|
282
|
offer = self.interop.toPlanB(offer);
|
282
|
283
|
self.trace('createOfferOnSuccess::postTransform (Plan B)', dumpSDP(offer));
|
283
|
284
|
}
|
|
@@ -303,7 +304,7 @@ TraceablePeerConnection.prototype.createAnswer = function (successCallback, fail
|
303
|
304
|
function (answer) {
|
304
|
305
|
self.trace('createAnswerOnSuccess::preTransfom', dumpSDP(answer));
|
305
|
306
|
// if we're running on FF, transform to Plan A first.
|
306
|
|
- if (navigator.mozGetUserMedia) {
|
|
307
|
+ if (RTCBrowserType.usesUnifiedPlan()) {
|
307
|
308
|
answer = self.interop.toPlanB(answer);
|
308
|
309
|
self.trace('createAnswerOnSuccess::postTransfom (Plan B)', dumpSDP(answer));
|
309
|
310
|
}
|
|
@@ -340,12 +341,11 @@ TraceablePeerConnection.prototype.addIceCandidate = function (candidate, success
|
340
|
341
|
};
|
341
|
342
|
|
342
|
343
|
TraceablePeerConnection.prototype.getStats = function(callback, errback) {
|
343
|
|
- if (navigator.mozGetUserMedia) {
|
|
344
|
+ // TODO: Is this the correct way to handle Opera, Temasys?
|
|
345
|
+ if (RTCBrowserType.isFirefox()) {
|
344
|
346
|
// ignore for now...
|
345
|
347
|
if(!errback)
|
346
|
|
- errback = function () {
|
347
|
|
-
|
348
|
|
- }
|
|
348
|
+ errback = function () {};
|
349
|
349
|
this.peerconnection.getStats(null,callback,errback);
|
350
|
350
|
} else {
|
351
|
351
|
this.peerconnection.getStats(callback);
|