|
@@ -16,28 +16,39 @@ function TraceablePeerConnection(ice_config, constraints) {
|
16
|
16
|
};
|
17
|
17
|
this.onicecandidate = null;
|
18
|
18
|
this.peerconnection.onicecandidate = function (event) {
|
|
19
|
+ self.trace('onicecandidate', event.candidate);
|
19
|
20
|
if (self.onicecandidate !== null) {
|
20
|
21
|
self.onicecandidate(event);
|
21
|
22
|
}
|
22
|
23
|
};
|
23
|
24
|
this.onaddstream = null;
|
24
|
25
|
this.peerconnection.onaddstream = function (event) {
|
|
26
|
+ self.trace('onaddstream', event.stream);
|
25
|
27
|
if (self.onaddstream !== null) {
|
26
|
28
|
self.onaddstream(event);
|
27
|
29
|
}
|
28
|
30
|
};
|
29
|
31
|
this.onremovestream = null;
|
30
|
32
|
this.peerconnection.onremovestream = function (event) {
|
|
33
|
+ self.trace('onremovestream', event.stream);
|
31
|
34
|
if (self.onremovestream !== null) {
|
32
|
35
|
self.onremovestream(event);
|
33
|
36
|
}
|
34
|
37
|
};
|
35
|
38
|
this.onsignalingstatechange = null;
|
36
|
39
|
this.peerconnection.onsignalingstatechange = function (event) {
|
|
40
|
+ self.trace('onsignalingstatechange', event);
|
37
|
41
|
if (self.onsignalingstatechange !== null) {
|
38
|
42
|
self.onsignalingstatechange(event);
|
39
|
43
|
}
|
40
|
44
|
};
|
|
45
|
+ this.oniceconnectionstatechange = null;
|
|
46
|
+ this.peerconnection.oniceconnectionstatechange = function (event) {
|
|
47
|
+ self.trace('oniceconnectionstatechange', event);
|
|
48
|
+ if (self.oniceconnectionstatechange !== null) {
|
|
49
|
+ self.oniceconnectionstatechange(event);
|
|
50
|
+ }
|
|
51
|
+ }
|
41
|
52
|
};
|
42
|
53
|
|
43
|
54
|
TraceablePeerConnection.prototype.__defineGetter__('signalingState', function() { return this.peerconnection.signalingState; });
|
|
@@ -178,8 +189,8 @@ function setupRTC() {
|
178
|
189
|
attachMediaStream: function (element, stream) {
|
179
|
190
|
element.attr('src', webkitURL.createObjectURL(stream));
|
180
|
191
|
},
|
181
|
|
-// pc_constraints: {} // FIVE-182
|
182
|
|
- pc_constraints: {'optional': [{'DtlsSrtpKeyAgreement': 'true'}]} // enable dtls support in canary
|
|
192
|
+ // DTLS should now be enabled by default but..
|
|
193
|
+ pc_constraints: {'optional': [{'DtlsSrtpKeyAgreement': 'true'}]}
|
183
|
194
|
};
|
184
|
195
|
if (navigator.userAgent.indexOf('Android') != -1) {
|
185
|
196
|
RTC.pc_constraints = {}; // disable DTLS on Android
|
|
@@ -443,7 +454,7 @@ Strophe.addConnectionPlugin('jingle', {
|
443
|
454
|
return true;
|
444
|
455
|
},
|
445
|
456
|
initiate: function (peerjid, myjid) { // initiate a new jinglesession to peerjid
|
446
|
|
- var sess = new JingleSession(myjid,
|
|
457
|
+ var sess = new JingleSession(myjid || this.connection.jid,
|
447
|
458
|
Math.random().toString(36).substr(2, 12), // random string
|
448
|
459
|
this.connection);
|
449
|
460
|
// configure session
|