|
|
@@ -1,4 +1,5 @@
|
|
1
|
1
|
/* jshint -W117 */
|
|
|
2
|
+var JingleSession = require("./JingleSession");
|
|
2
|
3
|
var TraceablePeerConnection = require("./TraceablePeerConnection");
|
|
3
|
4
|
var SDPDiffer = require("./SDPDiffer");
|
|
4
|
5
|
var SDPUtil = require("./SDPUtil");
|
|
|
@@ -11,6 +12,7 @@ var SSRCReplacement = require("./LocalSSRCReplacement");
|
|
11
|
12
|
|
|
12
|
13
|
// Jingle stuff
|
|
13
|
14
|
function JingleSessionPC(me, sid, connection, service, eventEmitter) {
|
|
|
15
|
+ JingleSession.call(this, me, sid, connection, service, eventEmitter);
|
|
14
|
16
|
this.me = me;
|
|
15
|
17
|
this.sid = sid;
|
|
16
|
18
|
this.connection = connection;
|
|
|
@@ -33,7 +35,6 @@ function JingleSessionPC(me, sid, connection, service, eventEmitter) {
|
|
33
|
35
|
|
|
34
|
36
|
this.usetrickle = true;
|
|
35
|
37
|
this.usepranswer = false; // early transport warmup -- mind you, this might fail. depends on webrtc issue 1718
|
|
36
|
|
- this.usedrip = false; // dripping is sending trickle candidates not one-by-one
|
|
37
|
38
|
|
|
38
|
39
|
this.hadstuncandidate = false;
|
|
39
|
40
|
this.hadturncandidate = false;
|
|
|
@@ -65,6 +66,17 @@ function JingleSessionPC(me, sid, connection, service, eventEmitter) {
|
|
65
|
66
|
// stable and the ice connection state is connected.
|
|
66
|
67
|
this.modifySourcesQueue.pause();
|
|
67
|
68
|
}
|
|
|
69
|
+JingleSessionPC.prototype = JingleSession.prototype;
|
|
|
70
|
+JingleSessionPC.prototype.constructor = JingleSessionPC;
|
|
|
71
|
+
|
|
|
72
|
+
|
|
|
73
|
+JingleSessionPC.prototype.setOffer = function(offer) {
|
|
|
74
|
+ this.setRemoteDescription(offer, 'offer');
|
|
|
75
|
+};
|
|
|
76
|
+
|
|
|
77
|
+JingleSessionPC.prototype.setAnswer = function(answer) {
|
|
|
78
|
+ this.setRemoteDescription(answer, 'answer');
|
|
|
79
|
+};
|
|
68
|
80
|
|
|
69
|
81
|
JingleSessionPC.prototype.updateModifySourcesQueue = function() {
|
|
70
|
82
|
var signalingState = this.peerconnection.signalingState;
|
|
|
@@ -339,7 +351,6 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|
339
|
351
|
initiator: this.initiator,
|
|
340
|
352
|
sid: this.sid});
|
|
341
|
353
|
this.localSDP = new SDP(this.peerconnection.localDescription.sdp);
|
|
342
|
|
- var self = this;
|
|
343
|
354
|
var sendJingle = function (ssrc) {
|
|
344
|
355
|
if(!ssrc)
|
|
345
|
356
|
ssrc = {};
|
|
|
@@ -368,7 +379,7 @@ JingleSessionPC.prototype.sendIceCandidate = function (candidate) {
|
|
368
|
379
|
JingleSessionPC.onJingleError(self.sid, error);
|
|
369
|
380
|
},
|
|
370
|
381
|
10000);
|
|
371
|
|
- }
|
|
|
382
|
+ };
|
|
372
|
383
|
sendJingle();
|
|
373
|
384
|
}
|
|
374
|
385
|
this.lasticecandidate = true;
|