hide large video if stream is muted

This commit is contained in:
isymchych 2016-02-10 17:16:55 +02:00
parent 61f4bb63ab
commit fdfa9de150
2 changed files with 13 additions and 16 deletions

View File

@ -307,9 +307,9 @@ class VideoContainer extends LargeContainer {
show () { show () {
let $wrapper = this.$wrapper; let $wrapper = this.$wrapper;
return new Promise(function(resolve) { return new Promise(function(resolve) {
$wrapper.css({visibility: 'visible'}); $wrapper.css('visibility', 'visible');
$wrapper.fadeTo(FADE_DURATION_MS, 1, function () { $wrapper.fadeTo(FADE_DURATION_MS, 1, function () {
$('.watermark').css({visibility: 'visible'}); $('.watermark').css('visibility', 'visible');
resolve(); resolve();
}); });
}); });
@ -317,12 +317,15 @@ class VideoContainer extends LargeContainer {
hide () { hide () {
let $wrapper = this.$wrapper; let $wrapper = this.$wrapper;
let id = this.id; let id = this.id;
return new Promise(function(resolve) { return new Promise(function(resolve) {
// There is no id on initial render
// so first time we hide wrapper immediately
// instead of slowly fading it out.
// This improves startup time.
$wrapper.fadeTo(id ? FADE_DURATION_MS : 1, 0, function () { $wrapper.fadeTo(id ? FADE_DURATION_MS : 1, 0, function () {
$wrapper.css({visibility: 'hidden'}); $wrapper.css('visibility', 'hidden');
$('.watermark').css({visibility: 'hidden'}); $('.watermark').css('visibility', 'hidden');
resolve(); resolve();
}); });
}); });
@ -514,14 +517,6 @@ export default class LargeVideoManager {
$("#dominantSpeakerAvatar").attr('src', avatarUrl); $("#dominantSpeakerAvatar").attr('src', avatarUrl);
} }
/**
* Show avatar on Large video container or not.
* @param {boolean} show
*/
showAvatar (show) {
this.videoContainer.showAvatar(show);
}
/** /**
* Add container of specified type. * Add container of specified type.
* @param {string} type container type * @param {string} type container type

View File

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