jingle-media-session
Advanced tools
Comparing version
20
index.js
@@ -55,4 +55,4 @@ var util = require('util'); | ||
this.pc.on('ice', this.onIceCandidate.bind(this)); | ||
this.pc.on('endOfCandidates', this.onIceEndOfCandidates.bind(this)); | ||
this.pc.on('ice', this.onIceCandidate.bind(this, opts)); | ||
this.pc.on('endOfCandidates', this.onIceEndOfCandidates.bind(this, opts)); | ||
this.pc.on('iceConnectionStateChange', this.onIceStateChange.bind(this)); | ||
@@ -358,9 +358,21 @@ this.pc.on('addStream', this.onAddStream.bind(this)); | ||
onIceCandidate: function (candidate) { | ||
onIceCandidate: function (opts, candidate) { | ||
this._log('info', 'Discovered new ICE candidate', candidate.jingle); | ||
this.send('transport-info', candidate.jingle); | ||
if (opts.signalEndOfCandidates) { | ||
this.lastCandidate = candidate; | ||
} | ||
}, | ||
onIceEndOfCandidates: function () { | ||
onIceEndOfCandidates: function (opts) { | ||
this._log('info', 'ICE end of candidates'); | ||
if (opts.signalEndOfCandidates) { | ||
var endOfCandidates = this.lastCandidate.jingle; | ||
endOfCandidates.contents[0].transport = { | ||
transportType: endOfCandidates.contents[0].transport.transportType, | ||
gatheringComplete: true | ||
}; | ||
this.lastCandidate = null; | ||
this.send('transport-info', endOfCandidates); | ||
} | ||
}, | ||
@@ -367,0 +379,0 @@ |
{ | ||
"name": "jingle-media-session", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"author": "Lance Stout <lance@andyet.net>", | ||
@@ -5,0 +5,0 @@ "bugs": "https://github.com/otalk/jingle-media-session/issues", |
25976
2.05%550
2.23%