Browse Source

feat(ConnectionIndicator): show disconnected GSM bars on local thumbnail

master
paweldomas 8 years ago
parent
commit
8a43699a89

+ 2
- 0
conference.js View File

1205
         room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
1205
         room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
1206
             connectionIsInterrupted = true;
1206
             connectionIsInterrupted = true;
1207
             ConnectionQuality.updateLocalConnectionQuality(0);
1207
             ConnectionQuality.updateLocalConnectionQuality(0);
1208
+            APP.UI.showLocalConnectionInterrupted(true);
1208
         });
1209
         });
1209
 
1210
 
1210
         room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
1211
         room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
1211
             connectionIsInterrupted = false;
1212
             connectionIsInterrupted = false;
1213
+            APP.UI.showLocalConnectionInterrupted(false);
1212
         });
1214
         });
1213
 
1215
 
1214
         room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, (id, displayName) => {
1216
         room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, (id, displayName) => {

+ 6
- 0
css/_videolayout_default.scss View File

221
     overflow: hidden;
221
     overflow: hidden;
222
 }
222
 }
223
 
223
 
224
+.connection.connection_lost
225
+{
226
+    color: #8B8B8B;
227
+    overflow: visible;
228
+}
229
+
224
 .connection.connection_full
230
 .connection.connection_full
225
 {
231
 {
226
     color: #FFFFFF;/*#15A1ED*/
232
     color: #FFFFFF;/*#15A1ED*/

+ 11
- 0
modules/UI/UI.js View File

261
     }
261
     }
262
 };
262
 };
263
 
263
 
264
+/**
265
+ * Shows/hides the indication about local connection being interrupted.
266
+ *
267
+ * @param {boolean} isInterrupted <tt>true</tt> if local connection is
268
+ * currently in the interrupted state or <tt>false</tt> if the connection
269
+ * is fine.
270
+ */
271
+UI.showLocalConnectionInterrupted = function (isInterrupted) {
272
+    VideoLayout.showLocalConnectionInterrupted(isInterrupted);
273
+};
274
+
264
 /**
275
 /**
265
  * Sets the "raised hand" status for a participant.
276
  * Sets the "raised hand" status for a participant.
266
  */
277
  */

+ 24
- 0
modules/UI/videolayout/ConnectionIndicator.js View File

285
         createIcon(["connection", "connection_empty"], "icon-connection"));
285
         createIcon(["connection", "connection_empty"], "icon-connection"));
286
     this.fullIcon = this.connectionIndicatorContainer.appendChild(
286
     this.fullIcon = this.connectionIndicatorContainer.appendChild(
287
         createIcon(["connection", "connection_full"], "icon-connection"));
287
         createIcon(["connection", "connection_full"], "icon-connection"));
288
+    this.interruptedIndicator = this.connectionIndicatorContainer.appendChild(
289
+        createIcon(["connection", "connection_lost"],"icon-connection-lost"));
290
+    $(this.interruptedIndicator).hide();
288
 };
291
 };
289
 
292
 
290
 /**
293
 /**
298
     this.popover.forceHide();
301
     this.popover.forceHide();
299
 };
302
 };
300
 
303
 
304
+/**
305
+ * Updates the UI which displays warning about user's connectivity problems.
306
+ *
307
+ * @param {boolean} isActive true if the connection is working fine or false if
308
+ * the user is having connectivity issues.
309
+ */
310
+ConnectionIndicator.prototype.updateConnectionStatusIndicator
311
+= function (isActive) {
312
+    this.isConnectionActive = isActive;
313
+    if (this.isConnectionActive) {
314
+        $(this.interruptedIndicator).hide();
315
+        $(this.emptyIcon).show();
316
+        $(this.fullIcon).show();
317
+    } else {
318
+        $(this.interruptedIndicator).show();
319
+        $(this.emptyIcon).hide();
320
+        $(this.fullIcon).hide();
321
+        this.updateConnectionQuality(0 /* zero bars */);
322
+    }
323
+};
324
+
301
 /**
325
 /**
302
  * Updates the data of the indicator
326
  * Updates the data of the indicator
303
  * @param percent the percent of connection quality
327
  * @param percent the percent of connection quality

+ 12
- 0
modules/UI/videolayout/VideoLayout.js View File

497
         localVideoThumbnail.showAudioIndicator(isMuted);
497
         localVideoThumbnail.showAudioIndicator(isMuted);
498
     },
498
     },
499
 
499
 
500
+    /**
501
+     * Shows/hides the indication about local connection being interrupted.
502
+     *
503
+     * @param {boolean} isInterrupted <tt>true</tt> if local connection is
504
+     * currently in the interrupted state or <tt>false</tt> if the connection
505
+     * is fine.
506
+     */
507
+    showLocalConnectionInterrupted (isInterrupted) {
508
+        localVideoThumbnail.connectionIndicator
509
+            .updateConnectionStatusIndicator(!isInterrupted);
510
+    },
511
+
500
     /**
512
     /**
501
      * Resizes thumbnails.
513
      * Resizes thumbnails.
502
      */
514
      */

Loading…
Cancel
Save