瀏覽代碼

Fixes issues with unloading the page

master
hristoterezov 9 年之前
父節點
當前提交
95b23f994c
共有 2 個文件被更改,包括 9 次插入9 次删除
  1. 9
    6
      app.js
  2. 0
    3
      libs/lib-jitsi-meet.js

+ 9
- 6
app.js 查看文件

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

+ 0
- 3
libs/lib-jitsi-meet.js 查看文件

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

Loading…
取消
儲存