From 95b23f994cc2a8aa02ee30e285674178d64d3386 Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Mon, 4 Jan 2016 14:55:43 -0600 Subject: [PATCH] Fixes issues with unloading the page --- app.js | 15 +++++++++------ libs/lib-jitsi-meet.js | 3 --- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app.js b/app.js index 14bdc92e4..08846373b 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 ab5854ae1..b90dbc93c 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;