@ndarilek/janus
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -0,1 +1,5 @@ | ||
# 0.5.1 (2016-04-26) | ||
* Fix issue where sessions would only poll once. | ||
# 0.5.0 (2016-04-25) | ||
@@ -2,0 +6,0 @@ |
@@ -11,3 +11,3 @@ import * as EventEmitter from "eventemitter3"; | ||
readonly id: number; | ||
private started; | ||
private polling; | ||
private connected; | ||
@@ -14,0 +14,0 @@ constructor(endpoint: string, start?: boolean, sessionId?: number); |
@@ -39,3 +39,3 @@ "use strict"; | ||
this.destroying = false; | ||
this.started = false; | ||
this.polling = false; | ||
this.connected = false; | ||
@@ -82,5 +82,5 @@ if (!endpoint || endpoint.length == 0) | ||
throw new Error("Session is destroying or destroyed, please create another"); | ||
if (this.started) | ||
if (this.polling) | ||
return; | ||
this.started = true; | ||
this.polling = true; | ||
janusFetch(this.fullEndpoint()) | ||
@@ -119,6 +119,11 @@ .then(function (r) { | ||
} | ||
if (!_this.destroyed && !_this.destroying) | ||
if (!_this.destroyed && !_this.destroying) { | ||
_this.polling = false; | ||
_this.poll(); | ||
} | ||
} | ||
}).catch(function (err) { return _this.emit("error", err); }); | ||
}).catch(function (err) { | ||
_this.emit("error", err); | ||
_this.polling = false; | ||
}); | ||
}; | ||
@@ -166,3 +171,3 @@ Session.prototype.attach = function (pluginId) { | ||
}); }).then(function (r) { | ||
_this.started = false; | ||
_this.polling = false; | ||
_this.destroying = false; | ||
@@ -169,0 +174,0 @@ _this.destroyed = true; |
{ | ||
"name": "@ndarilek/janus", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Simple API for the Janus media server", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
32128
790