webrtc
Advanced tools
Comparing version 1.12.0 to 1.13.0
{ | ||
"name": "webrtc", | ||
"version": "1.12.0", | ||
"version": "1.13.0", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "webrtc", |
16
peer.js
@@ -24,2 +24,8 @@ var util = require('util'); | ||
this.pc.on('ice', this.onIceCandidate.bind(this)); | ||
this.pc.on('offer', function (offer) { | ||
self.send('offer', offer); | ||
}); | ||
this.pc.on('answer', function (offer) { | ||
self.send('answer', offer); | ||
}); | ||
this.pc.on('addStream', this.handleRemoteStreamAdded.bind(this)); | ||
@@ -89,3 +95,3 @@ this.pc.on('addChannel', this.handleDataChannelAdded.bind(this)); | ||
self.pc.answer(self.receiveMedia, function (err, sessionDescription) { | ||
self.send('answer', sessionDescription); | ||
//self.send('answer', sessionDescription); | ||
}); | ||
@@ -179,6 +185,12 @@ }); | ||
this.pc.offer(this.receiveMedia, function (err, sessionDescription) { | ||
self.send('offer', sessionDescription); | ||
//self.send('offer', sessionDescription); | ||
}); | ||
}; | ||
Peer.prototype.icerestart = function () { | ||
var constraints = this.receiveMedia; | ||
constraints.mandatory.IceRestart = true; | ||
this.pc.offer(constraints, function (err, success) { }); | ||
}; | ||
Peer.prototype.end = function () { | ||
@@ -185,0 +197,0 @@ if (this.closed) return; |
164690
4377