diff --git a/static/js/mediastream/api.js b/static/js/mediastream/api.js index a75ba49b..5164f4ae 100644 --- a/static/js/mediastream/api.js +++ b/static/js/mediastream/api.js @@ -49,7 +49,7 @@ define(['jquery', 'underscore'], function($, _) { console.log("Reconnecting because alive timeout was reached."); this.last_receive_overdue = false; this.last_receive = null; - this.connector.reconnect(); + this.connector.disconnect(true); } } else { if (now > last_receive + alive_check_timeout) { diff --git a/static/js/mediastream/connector.js b/static/js/mediastream/connector.js index 3209879f..3718106a 100644 --- a/static/js/mediastream/connector.js +++ b/static/js/mediastream/connector.js @@ -80,6 +80,16 @@ define(['jquery', 'underscore', 'ua-parser'], function($, _, uaparser) { }; + Connector.prototype.disconnect = function(error) { + + if (error) { + this.onerror(null) + } else { + this.conn.close(); + } + + }; + Connector.prototype.reconnect = function() { if (!this.url) {