Browse Source

Fixes issues with unloading the page

master
hristoterezov 10 years ago
parent
commit
95b23f994c
2 changed files with 9 additions and 9 deletions
  1. 9
    6
      app.js
  2. 0
    3
      libs/lib-jitsi-meet.js

+ 9
- 6
app.js View File

@@ -210,12 +210,12 @@ function initConference(localTracks, connection) {
210 210
 
211 211
 
212 212
     room.on(ConferenceEvents.USER_JOINED, function (id, user) {
213
-        console.error('USER %s connnected', id, user);
213
+        console.log('USER %s connnected', id, user);
214 214
         // FIXME email???
215 215
         APP.UI.addUser(id, user.getDisplayName());
216 216
     });
217 217
     room.on(ConferenceEvents.USER_LEFT, function (id, user) {
218
-        console.error('USER %s LEFT', id, user);
218
+        console.log('USER %s LEFT', id, user);
219 219
         APP.UI.removeUser(id, user.getDisplayName());
220 220
         APP.UI.stopPrezi(id);
221 221
     });
@@ -254,7 +254,7 @@ function initConference(localTracks, connection) {
254 254
         if (track.isLocal()) { // skip local tracks
255 255
             return;
256 256
         }
257
-        console.error(
257
+        console.log(
258 258
             'REMOTE %s TRACK', track.getType(), track.getParticipantId()
259 259
         );
260 260
         APP.UI.addRemoteStream(track);
@@ -264,7 +264,7 @@ function initConference(localTracks, connection) {
264 264
             return;
265 265
         }
266 266
 
267
-        console.error(
267
+        console.log(
268 268
             'REMOTE %s TRACK REMOVED', track.getType(), track.getParticipantId()
269 269
         );
270 270
 
@@ -556,9 +556,12 @@ function initConference(localTracks, connection) {
556 556
         }
557 557
     );
558 558
 
559
-    $(window).bind('beforeunload', function () {
559
+    const unload = () => {
560 560
         room.leave();
561
-    });
561
+        connection.disconnect();
562
+    };
563
+    $(window).bind('beforeunload', unload );
564
+    $(window).bind('unload', unload );
562 565
 
563 566
     return new Promise(function (resolve, reject) {
564 567
         room.on(ConferenceEvents.CONFERENCE_JOINED, handleConferenceJoined);

+ 0
- 3
libs/lib-jitsi-meet.js View File

@@ -6289,7 +6289,6 @@ ChatRoom.prototype.createNonAnonymousRoom = function () {
6289 6289
 };
6290 6290
 
6291 6291
 ChatRoom.prototype.onPresence = function (pres) {
6292
-    console.log(pres);
6293 6292
     var from = pres.getAttribute('from');
6294 6293
     // Parse roles.
6295 6294
     var member = {};
@@ -6326,7 +6325,6 @@ ChatRoom.prototype.onPresence = function (pres) {
6326 6325
                     if (displayName && displayName.length > 0) {
6327 6326
                         this.eventEmitter.emit(XMPPEvents.DISPLAY_NAME_CHANGED, from, displayName);
6328 6327
                     }
6329
-                    logger.info("Display name: " + displayName, pres);
6330 6328
                 }
6331 6329
                 break;
6332 6330
             case "userId":
@@ -6345,7 +6343,6 @@ ChatRoom.prototype.onPresence = function (pres) {
6345 6343
                 var jibri = node;
6346 6344
                 break;
6347 6345
             case "call-control":
6348
-                console.log(pres);
6349 6346
                 var att = node.attributes;
6350 6347
                 if(!att)
6351 6348
                     break;

Loading…
Cancel
Save