repo: janusweb action: commit revision: path_from: revision_from: 3fa5f3cb5b4fee1a79d90520b97caa8656ddfbb1: path_to: revision_to:
commit 3fa5f3cb5b4fee1a79d90520b97caa8656ddfbb1 Author: James BaicoianuDate: Mon Oct 17 02:01:47 2016 -0700 Send leave_room events when leaving rooms diff --git a/scripts/external/JanusClientConnection.js b/scripts/external/JanusClientConnection.js
--- a/scripts/external/JanusClientConnection.js
+++ b/scripts/external/JanusClientConnection.js
@@ -409,4 +409,12 @@ JanusClientConnection.prototype.enter_room = function(url) {
}
});
};
+JanusClientConnection.prototype.leave_room = function(url) {
+ this.send({
+ 'method': 'leave_room',
+ 'data': {
+ 'roomId': md5(url)
+ }
+ });
+};
diff --git a/scripts/janusweb.js b/scripts/janusweb.js
--- a/scripts/janusweb.js
+++ b/scripts/janusweb.js
@@ -211,6 +211,7 @@ setTimeout(function() {
//setTimeout(elation.bind(this.currentroom, this.currentroom.die), 1000);
//this.currentroom.die();
this.currentroom.disable();
+ this.leave_room(this.currentroom.url);
this.currentroom = false;
}
this.refresh();
@@ -359,6 +360,11 @@ setTimeout(function() {
this.network.enter_room(url);
}
}
+ this.leave_room = function(url) {
+ if (this.network) {
+ this.network.leave_room(url);
+ }
+ }
this.onJanusMessage = function(msg) {
var method = msg.data.method
if (method == 'user_moved') {
@@ -455,6 +461,7 @@ setTimeout(function() {
if (remote.room !== room) {
room.add(remote);
+ remote.room = room;
}
if (movedata.dir) {
-----END OF PAGE-----