Просмотр исходного кода

feat: moves isConnectionInterrupted to lib-jitsi-meet.

j8
Boris Grozev 8 лет назад
Родитель
Сommit
4aa47a7901
1 измененных файлов: 3 добавлений и 11 удалений
  1. 3
    11
      conference.js

+ 3
- 11
conference.js Просмотреть файл

@@ -26,11 +26,6 @@ const ConnectionQualityEvents = JitsiMeetJS.events.connectionQuality;
26 26
 
27 27
 let room, connection, localAudio, localVideo;
28 28
 
29
-/**
30
- * Indicates whether the connection is interrupted or not.
31
- */
32
-let connectionIsInterrupted = false;
33
-
34 29
 /**
35 30
  * Indicates whether extension external installation is in progress or not.
36 31
  */
@@ -677,7 +672,7 @@ export default {
677 672
      * false otherwise.
678 673
      */
679 674
     isConnectionInterrupted () {
680
-        return connectionIsInterrupted;
675
+        return this._room.isConnectionInterrupted();
681 676
     },
682 677
     /**
683 678
      * Finds JitsiParticipant for given id.
@@ -1100,7 +1095,6 @@ export default {
1100 1095
         room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
1101 1096
             APP.UI.mucJoined();
1102 1097
             APP.API.notifyConferenceJoined(APP.conference.roomName);
1103
-            connectionIsInterrupted = false;
1104 1098
             APP.UI.markVideoInterrupted(false);
1105 1099
         });
1106 1100
 
@@ -1249,12 +1243,10 @@ export default {
1249 1243
         }
1250 1244
 
1251 1245
         room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
1252
-            connectionIsInterrupted = true;
1253 1246
             APP.UI.showLocalConnectionInterrupted(true);
1254 1247
         });
1255 1248
 
1256 1249
         room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
1257
-            connectionIsInterrupted = false;
1258 1250
             APP.UI.showLocalConnectionInterrupted(false);
1259 1251
         });
1260 1252
 
@@ -1307,12 +1299,12 @@ export default {
1307 1299
         }
1308 1300
 
1309 1301
         // TODO: Move this to the library.
1310
-        room.on(ConferenceEvents.CONNECTION_STATS, function (stats) {
1302
+        room.on(ConferenceEvents.CONNECTION_STATS, (stats) => {
1311 1303
             // if we say video muted we will use old method of calculating
1312 1304
             // quality and will not depend on localVideo if it is missing
1313 1305
             room.connectionQuality.updateLocalStats(
1314 1306
                 stats,
1315
-                connectionIsInterrupted,
1307
+                this.isConnectionInterrupted(),
1316 1308
                 localVideo ? localVideo.videoType : undefined,
1317 1309
                 localVideo ? localVideo.isMuted() : true,
1318 1310
                 localVideo ? localVideo.resolution : null);

Загрузка…
Отмена
Сохранить