瀏覽代碼

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

j8
paweldomas 8 年之前
父節點
當前提交
8a43699a89

+ 2
- 0
conference.js 查看文件

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

+ 6
- 0
css/_videolayout_default.scss 查看文件

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

+ 11
- 0
modules/UI/UI.js 查看文件

@@ -261,6 +261,17 @@ UI.changeDisplayName = function (id, displayName) {
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 276
  * Sets the "raised hand" status for a participant.
266 277
  */

+ 24
- 0
modules/UI/videolayout/ConnectionIndicator.js 查看文件

@@ -285,6 +285,9 @@ ConnectionIndicator.prototype.create = function () {
285 285
         createIcon(["connection", "connection_empty"], "icon-connection"));
286 286
     this.fullIcon = this.connectionIndicatorContainer.appendChild(
287 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,6 +301,27 @@ ConnectionIndicator.prototype.remove = function() {
298 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 326
  * Updates the data of the indicator
303 327
  * @param percent the percent of connection quality

+ 12
- 0
modules/UI/videolayout/VideoLayout.js 查看文件

@@ -497,6 +497,18 @@ var VideoLayout = {
497 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 513
      * Resizes thumbnails.
502 514
      */

Loading…
取消
儲存