|
@@ -102,11 +102,11 @@ function computeCameraVideoSize(videoWidth,
|
102
|
102
|
if (aspectRatio <= 1) {
|
103
|
103
|
const zoomRateHeight = videoSpaceHeight / videoHeight;
|
104
|
104
|
const zoomRateWidth = videoSpaceWidth / videoWidth;
|
105
|
|
- const maxZoomRate
|
106
|
|
- = interfaceConfig.MAXIMUM_ZOOMING_COEFFICIENT || Infinity;
|
107
|
|
- let zoomRate = Math.min(zoomRateWidth, maxZoomRate);
|
|
105
|
+ const zoomRate = Math.min(
|
|
106
|
+ zoomRateWidth,
|
|
107
|
+ zoomRateHeight,
|
|
108
|
+ interfaceConfig.MAXIMUM_ZOOMING_COEFFICIENT || Infinity);
|
108
|
109
|
|
109
|
|
- zoomRate = Math.max(zoomRate, zoomRateHeight);
|
110
|
110
|
availableWidth = videoWidth * zoomRate;
|
111
|
111
|
availableHeight = videoHeight * zoomRate;
|
112
|
112
|
} else if (availableHeight * aspectRatio < videoSpaceWidth) {
|
|
@@ -166,6 +166,10 @@ export class VideoContainer extends LargeContainer {
|
166
|
166
|
return $('#largeVideo');
|
167
|
167
|
}
|
168
|
168
|
|
|
169
|
+ get $videoBackground() {
|
|
170
|
+ return $('#largeVideoBackground');
|
|
171
|
+ }
|
|
172
|
+
|
169
|
173
|
get id () {
|
170
|
174
|
return getStreamOwnerId(this.stream);
|
171
|
175
|
}
|
|
@@ -255,6 +259,7 @@ export class VideoContainer extends LargeContainer {
|
255
|
259
|
*/
|
256
|
260
|
enableLocalConnectionProblemFilter (enable) {
|
257
|
261
|
this.$video.toggleClass("videoProblemFilter", enable);
|
|
262
|
+ this.$videoBackground.toggleClass("videoProblemFilter", enable);
|
258
|
263
|
}
|
259
|
264
|
|
260
|
265
|
/**
|
|
@@ -345,8 +350,15 @@ export class VideoContainer extends LargeContainer {
|
345
|
350
|
return;
|
346
|
351
|
}
|
347
|
352
|
|
348
|
|
- let [width, height]
|
|
353
|
+ this._hideVideoBackground();
|
|
354
|
+
|
|
355
|
+ let [ width, height ]
|
349
|
356
|
= this.getVideoSize(containerWidth, containerHeight);
|
|
357
|
+
|
|
358
|
+ if (containerWidth > width) {
|
|
359
|
+ this._showVideoBackground();
|
|
360
|
+ }
|
|
361
|
+
|
350
|
362
|
let { horizontalIndent, verticalIndent }
|
351
|
363
|
= this.getVideoPosition(width, height,
|
352
|
364
|
containerWidth, containerHeight);
|
|
@@ -408,6 +420,7 @@ export class VideoContainer extends LargeContainer {
|
408
|
420
|
// detach old stream
|
409
|
421
|
if (this.stream) {
|
410
|
422
|
this.stream.detach(this.$video[0]);
|
|
423
|
+ this.stream.detach(this.$videoBackground[0]);
|
411
|
424
|
}
|
412
|
425
|
|
413
|
426
|
this.stream = stream;
|
|
@@ -418,10 +431,18 @@ export class VideoContainer extends LargeContainer {
|
418
|
431
|
}
|
419
|
432
|
|
420
|
433
|
stream.attach(this.$video[0]);
|
421
|
|
- let flipX = stream.isLocal() && this.localFlipX;
|
|
434
|
+ stream.attach(this.$videoBackground[0]);
|
|
435
|
+
|
|
436
|
+ this._hideVideoBackground();
|
|
437
|
+
|
|
438
|
+ const flipX = stream.isLocal() && this.localFlipX;
|
|
439
|
+
|
422
|
440
|
this.$video.css({
|
423
|
441
|
transform: flipX ? 'scaleX(-1)' : 'none'
|
424
|
442
|
});
|
|
443
|
+ this.$videoBackground.css({
|
|
444
|
+ transform: flipX ? 'scaleX(-1)' : 'none'
|
|
445
|
+ });
|
425
|
446
|
|
426
|
447
|
// Reset the large video background depending on the stream.
|
427
|
448
|
this.setLargeVideoBackground(this.avatarDisplayed);
|
|
@@ -438,8 +459,13 @@ export class VideoContainer extends LargeContainer {
|
438
|
459
|
this.$video.css({
|
439
|
460
|
transform: this.localFlipX ? 'scaleX(-1)' : 'none'
|
440
|
461
|
});
|
|
462
|
+
|
|
463
|
+ this.$videoBackground.css({
|
|
464
|
+ transform: this.localFlipX ? 'scaleX(-1)' : 'none'
|
|
465
|
+ });
|
441
|
466
|
}
|
442
|
467
|
|
|
468
|
+
|
443
|
469
|
/**
|
444
|
470
|
* Check if current video stream is screen sharing.
|
445
|
471
|
* @returns {boolean}
|
|
@@ -476,6 +502,8 @@ export class VideoContainer extends LargeContainer {
|
476
|
502
|
*/
|
477
|
503
|
showRemoteConnectionProblemIndicator (show) {
|
478
|
504
|
this.$video.toggleClass("remoteVideoProblemFilter", show);
|
|
505
|
+ this.$videoBackground.toggleClass("remoteVideoProblemFilter", show);
|
|
506
|
+
|
479
|
507
|
this.$avatar.toggleClass("remoteVideoProblemFilter", show);
|
480
|
508
|
}
|
481
|
509
|
|
|
@@ -544,6 +572,17 @@ export class VideoContainer extends LargeContainer {
|
544
|
572
|
? "#000" : interfaceConfig.DEFAULT_BACKGROUND);
|
545
|
573
|
}
|
546
|
574
|
|
|
575
|
+ /**
|
|
576
|
+ * Sets the blur background to be invisible and pauses any playing video.
|
|
577
|
+ *
|
|
578
|
+ * @private
|
|
579
|
+ * @returns {void}
|
|
580
|
+ */
|
|
581
|
+ _hideVideoBackground() {
|
|
582
|
+ this.$videoBackground.css({ visibility: 'hidden' });
|
|
583
|
+ this.$videoBackground[0].pause();
|
|
584
|
+ }
|
|
585
|
+
|
547
|
586
|
/**
|
548
|
587
|
* Callback invoked when the video element changes dimensions.
|
549
|
588
|
*
|
|
@@ -553,4 +592,15 @@ export class VideoContainer extends LargeContainer {
|
553
|
592
|
_onResize() {
|
554
|
593
|
this._resizeListeners.forEach(callback => callback());
|
555
|
594
|
}
|
|
595
|
+
|
|
596
|
+ /**
|
|
597
|
+ * Sets the blur background to be visible and starts any loaded video.
|
|
598
|
+ *
|
|
599
|
+ * @private
|
|
600
|
+ * @returns {void}
|
|
601
|
+ */
|
|
602
|
+ _showVideoBackground() {
|
|
603
|
+ this.$videoBackground.css({ visibility: 'visible' });
|
|
604
|
+ this.$videoBackground[0].play();
|
|
605
|
+ }
|
556
|
606
|
}
|