Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Fixes issues with unloading the page

hristoterezov95b23f994cc2
diff --git a/app.js b/app.js
index 14bdc92e44..08846373b5 100644
--- a/app.js
+++ b/app.js
@@ -210,12 +210,12 @@ function initConference(localTracks, connection) {
room.on(ConferenceEvents.USER_JOINED, function (id, user) {
- console.error('USER %s connnected', id, user);
+ console.log('USER %s connnected', id, user);
// FIXME email???
APP.UI.addUser(id, user.getDisplayName());
});
room.on(ConferenceEvents.USER_LEFT, function (id, user) {
- console.error('USER %s LEFT', id, user);
+ console.log('USER %s LEFT', id, user);
APP.UI.removeUser(id, user.getDisplayName());
APP.UI.stopPrezi(id);
});
@@ -254,7 +254,7 @@ function initConference(localTracks, connection) {
if (track.isLocal()) { // skip local tracks
return;
}
- console.error(
+ console.log(
'REMOTE %s TRACK', track.getType(), track.getParticipantId()
);
APP.UI.addRemoteStream(track);
@@ -264,7 +264,7 @@ function initConference(localTracks, connection) {
return;
}
- console.error(
+ console.log(
'REMOTE %s TRACK REMOVED', track.getType(), track.getParticipantId()
);
@@ -556,9 +556,12 @@ function initConference(localTracks, connection) {
}
);
- $(window).bind('beforeunload', function () {
+ const unload = () => {
room.leave();
- });
+ connection.disconnect();
+ };
+ $(window).bind('beforeunload', unload );
+ $(window).bind('unload', unload );
return new Promise(function (resolve, reject) {
room.on(ConferenceEvents.CONFERENCE_JOINED, handleConferenceJoined);
diff --git a/libs/lib-jitsi-meet.js b/libs/lib-jitsi-meet.js
index ab5854ae1f..b90dbc93cd 100644
--- a/libs/lib-jitsi-meet.js
+++ b/libs/lib-jitsi-meet.js
@@ -6289,7 +6289,6 @@ ChatRoom.prototype.createNonAnonymousRoom = function () {
};
ChatRoom.prototype.onPresence = function (pres) {
- console.log(pres);
var from = pres.getAttribute('from');
// Parse roles.
var member = {};
@@ -6326,7 +6325,6 @@ ChatRoom.prototype.onPresence = function (pres) {
if (displayName && displayName.length > 0) {
this.eventEmitter.emit(XMPPEvents.DISPLAY_NAME_CHANGED, from, displayName);
}
- logger.info("Display name: " + displayName, pres);
}
break;
case "userId":
@@ -6345,7 +6343,6 @@ ChatRoom.prototype.onPresence = function (pres) {
var jibri = node;
break;
case "call-control":
- console.log(pres);
var att = node.attributes;
if(!att)
break;