jingle
Advanced tools
Comparing version 0.4.7 to 0.4.8
@@ -14,3 +14,12 @@ var bows = require('bows'); | ||
// actions defined in http://xmpp.org/extensions/xep-0166.html#def-action | ||
var actions = [ | ||
'content-accept', 'content-add', 'content-modify', | ||
'content-reject', 'content-remove', 'description-info', | ||
'session-accept', 'session-info', 'session-initiate', | ||
'session-terminate', 'transport-accept', 'transport-info', | ||
'transport-reject', 'transport-replace' | ||
]; | ||
function JingleSession(opts) { | ||
@@ -30,3 +39,12 @@ var self = this; | ||
log(self.sid + ': ' + action); | ||
self[action](changes, function (err) { | ||
if (actions.indexOf(action) === -1) { | ||
log(this.sid + ': Invalid action ' + action); | ||
cb({condition: 'bad-request'}); | ||
next(); | ||
return; | ||
} | ||
var method = actionToMethod(action); | ||
self[method](changes, function (err) { | ||
cb(err); | ||
@@ -46,6 +64,4 @@ next(); | ||
JingleSession.prototype.process = function (action, changes, cb) { | ||
var method = actionToMethod(action); | ||
this.processingQueue.push({ | ||
action: method, | ||
action: action, | ||
changes: changes, | ||
@@ -129,10 +145,2 @@ cb: cb | ||
var actions = [ | ||
'content-accept', 'content-add', 'content-modify', | ||
'content-reject', 'content-remove', 'description-info', | ||
'session-accept', 'session-info', 'session-initiate', | ||
'session-terminate', 'transport-accept', 'transport-info', | ||
'transport-reject', 'transport-replace' | ||
]; | ||
actions.forEach(function (action) { | ||
@@ -139,0 +147,0 @@ var method = actionToMethod(action); |
@@ -21,5 +21,5 @@ var _ = require('underscore'); | ||
this.pc = new RTCPeerConnection(config, constraints); | ||
this.pc.on('ice', this.onIceCandidate.bind(this)); | ||
this.pc.on('addStream', this.onStreamAdded.bind(this)); | ||
this.pc.on('removeStream', this.onStreamRemoved.bind(this)); | ||
this.pc.on('ice', this._onIceCandidate.bind(this)); | ||
this.pc.on('addStream', this._onStreamAdded.bind(this)); | ||
this.pc.on('removeStream', this._onStreamRemoved.bind(this)); | ||
this.pc.on('iceConnectionStateChange', function () { | ||
@@ -210,7 +210,7 @@ switch (self.pc.iceConnectionState) { | ||
}, | ||
onIceCandidate: function (candidateInfo) { | ||
_onIceCandidate: function (candidateInfo) { | ||
log(this.sid + ': Discovered new ICE candidate', candidateInfo.jingle); | ||
this.send('transport-info', candidateInfo.jingle); | ||
}, | ||
onStreamAdded: function (event) { | ||
_onStreamAdded: function (event) { | ||
log(this.sid + ': Remote media stream added'); | ||
@@ -227,3 +227,3 @@ | ||
}, | ||
onStreamRemoved: function (event) { | ||
_onStreamRemoved: function (event) { | ||
log(this.sid + ': Remote media stream removed'); | ||
@@ -230,0 +230,0 @@ this.parent.emit('peerStreamRemoved', this, event.stream); |
{ | ||
"name": "jingle", | ||
"description": "Generic Jingle via WebRTC session manager.", | ||
"version": "0.4.7", | ||
"version": "0.4.8", | ||
"author": "Lance Stout <lance@andyet.net>", | ||
@@ -15,3 +15,3 @@ "bugs": "https://github.com/legastero/jingle.js/issues", | ||
"getusermedia": "0.2.x", | ||
"hark": "0.2.x", | ||
"hark": "^1.0.0", | ||
"mediastream-gain": "0.1.x", | ||
@@ -26,3 +26,3 @@ "mockconsole": "0.0.x", | ||
"devDependencies": { | ||
"browserify": "3.x", | ||
"browserify": "4.x", | ||
"grunt": "0.4.x", | ||
@@ -29,0 +29,0 @@ "grunt-browserify": "2.x", |
674
27948
13
+ Addedhark@1.2.3(transitive)
- Removedhark@0.2.1(transitive)
- Removedwildemitter@1.0.2(transitive)
Updatedhark@^1.0.0