|
@@ -1,6 +1,7 @@
|
1
|
|
-/* global APP, $ */
|
|
1
|
+/* global APP, $, config */
|
2
|
2
|
/* jshint -W101 */
|
3
|
3
|
import JitsiPopover from "../util/JitsiPopover";
|
|
4
|
+import VideoLayout from "./VideoLayout";
|
4
|
5
|
|
5
|
6
|
/**
|
6
|
7
|
* Constructs new connection indicator.
|
|
@@ -14,6 +15,7 @@ function ConnectionIndicator(videoContainer, id) {
|
14
|
15
|
this.bitrate = null;
|
15
|
16
|
this.showMoreValue = false;
|
16
|
17
|
this.resolution = null;
|
|
18
|
+ this.isResolutionHD = null;
|
17
|
19
|
this.transport = [];
|
18
|
20
|
this.popover = null;
|
19
|
21
|
this.id = id;
|
|
@@ -292,7 +294,6 @@ ConnectionIndicator.prototype.remove = function() {
|
292
|
294
|
*/
|
293
|
295
|
ConnectionIndicator.prototype.updateConnectionQuality =
|
294
|
296
|
function (percent, object) {
|
295
|
|
-
|
296
|
297
|
if (percent === null) {
|
297
|
298
|
this.connectionIndicatorContainer.style.display = "none";
|
298
|
299
|
this.popover.forceHide();
|
|
@@ -316,6 +317,10 @@ ConnectionIndicator.prototype.updateConnectionQuality =
|
316
|
317
|
ConnectionIndicator.connectionQualityValues[quality];
|
317
|
318
|
}
|
318
|
319
|
}
|
|
320
|
+ if (object.isResolutionHD) {
|
|
321
|
+ this.isResolutionHD = object.isResolutionHD;
|
|
322
|
+ }
|
|
323
|
+ this.updateResolutionIndicator();
|
319
|
324
|
this.updatePopoverData();
|
320
|
325
|
};
|
321
|
326
|
|
|
@@ -325,6 +330,7 @@ ConnectionIndicator.prototype.updateConnectionQuality =
|
325
|
330
|
*/
|
326
|
331
|
ConnectionIndicator.prototype.updateResolution = function (resolution) {
|
327
|
332
|
this.resolution = resolution;
|
|
333
|
+ this.updateResolutionIndicator();
|
328
|
334
|
this.updatePopoverData();
|
329
|
335
|
};
|
330
|
336
|
|
|
@@ -354,4 +360,29 @@ ConnectionIndicator.prototype.hideIndicator = function () {
|
354
|
360
|
this.popover.forceHide();
|
355
|
361
|
};
|
356
|
362
|
|
|
363
|
+/**
|
|
364
|
+ * Updates the resolution indicator.
|
|
365
|
+ */
|
|
366
|
+ConnectionIndicator.prototype.updateResolutionIndicator = function () {
|
|
367
|
+
|
|
368
|
+ if (this.id !== null
|
|
369
|
+ && VideoLayout.isCurrentlyOnLarge(this.id)) {
|
|
370
|
+
|
|
371
|
+ let showResolutionLabel = false;
|
|
372
|
+
|
|
373
|
+ if (this.isResolutionHD !== null)
|
|
374
|
+ showResolutionLabel = this.isResolutionHD;
|
|
375
|
+ else if (this.resolution !== null) {
|
|
376
|
+ let resolutions = this.resolution || {};
|
|
377
|
+ Object.keys(resolutions).map(function (ssrc) {
|
|
378
|
+ let {width, height} = resolutions[ssrc];
|
|
379
|
+ if (height >= config.minHDResolution)
|
|
380
|
+ showResolutionLabel = true;
|
|
381
|
+ });
|
|
382
|
+ }
|
|
383
|
+
|
|
384
|
+ VideoLayout.updateResolutionLabel(showResolutionLabel);
|
|
385
|
+ }
|
|
386
|
+};
|
|
387
|
+
|
357
|
388
|
export default ConnectionIndicator;
|