Selaa lähdekoodia

hide large video if stream is muted

j8
isymchych 9 vuotta sitten
vanhempi
commit
fdfa9de150
2 muutettua tiedostoa jossa 13 lisäystä ja 16 poistoa
  1. 8
    13
      modules/UI/videolayout/LargeVideo.js
  2. 5
    3
      modules/UI/videolayout/VideoLayout.js

+ 8
- 13
modules/UI/videolayout/LargeVideo.js Näytä tiedosto

@@ -307,9 +307,9 @@ class VideoContainer extends LargeContainer {
307 307
     show () {
308 308
         let $wrapper = this.$wrapper;
309 309
         return new Promise(function(resolve) {
310
-            $wrapper.css({visibility: 'visible'});
310
+            $wrapper.css('visibility', 'visible');
311 311
             $wrapper.fadeTo(FADE_DURATION_MS, 1, function () {
312
-                $('.watermark').css({visibility: 'visible'});
312
+                $('.watermark').css('visibility', 'visible');
313 313
                 resolve();
314 314
             });
315 315
         });
@@ -317,12 +317,15 @@ class VideoContainer extends LargeContainer {
317 317
 
318 318
     hide () {
319 319
         let $wrapper = this.$wrapper;
320
-
321 320
         let id = this.id;
322 321
         return new Promise(function(resolve) {
322
+            // There is no id on initial render
323
+            // so first time we hide wrapper immediately
324
+            // instead of slowly fading it out.
325
+            // This improves startup time.
323 326
             $wrapper.fadeTo(id ? FADE_DURATION_MS : 1, 0, function () {
324
-                $wrapper.css({visibility: 'hidden'});
325
-                $('.watermark').css({visibility: 'hidden'});
327
+                $wrapper.css('visibility', 'hidden');
328
+                $('.watermark').css('visibility', 'hidden');
326 329
                 resolve();
327 330
             });
328 331
         });
@@ -514,14 +517,6 @@ export default class LargeVideoManager {
514 517
         $("#dominantSpeakerAvatar").attr('src', avatarUrl);
515 518
     }
516 519
 
517
-    /**
518
-     * Show avatar on Large video container or not.
519
-     * @param {boolean} show
520
-     */
521
-    showAvatar (show) {
522
-        this.videoContainer.showAvatar(show);
523
-    }
524
-
525 520
     /**
526 521
      * Add container of specified type.
527 522
      * @param {string} type container type

+ 5
- 3
modules/UI/videolayout/VideoLayout.js Näytä tiedosto

@@ -1,4 +1,4 @@
1
-/* global config, APP, $, interfaceConfig */
1
+/* global config, APP, $, interfaceConfig, JitsiMeetJS */
2 2
 /* jshint -W101 */
3 3
 
4 4
 import AudioLevels from "../audio_levels/AudioLevels";
@@ -504,8 +504,10 @@ var VideoLayout = {
504 504
             remoteVideo.setMutedView(value);
505 505
         }
506 506
 
507
-        if(this.isCurrentlyOnLarge(id))
508
-            largeVideo.showAvatar(value);
507
+        if (this.isCurrentlyOnLarge(id)) {
508
+            // large video will show avatar instead of muted stream
509
+            this.updateLargeVideo(id, true);
510
+        }
509 511
     },
510 512
 
511 513
     /**

Loading…
Peruuta
Tallenna