Fixes shifted audio level glow on thumbnails. Fixes missing audio level indicator on large video avatar.
This commit is contained in:
parent
4228537390
commit
e7e8dc3457
|
@ -420,7 +420,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
z-index: 1;
|
z-index: 2;
|
||||||
visibility: inherit;
|
visibility: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
z-index: 2;
|
z-index: 3;
|
||||||
visibility: inherit;
|
visibility: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,8 @@ function drawAudioLevelCanvas(id, audioLevel) {
|
||||||
* been observed to pile into the console, strain the CPU.
|
* been observed to pile into the console, strain the CPU.
|
||||||
*/
|
*/
|
||||||
if (audioLevelCanvasOrig) {
|
if (audioLevelCanvasOrig) {
|
||||||
audioLevelCanvasCache[id] = CanvasUtil.cloneCanvas(audioLevelCanvasOrig);
|
audioLevelCanvasCache[id]
|
||||||
|
= CanvasUtil.cloneCanvas(audioLevelCanvasOrig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +69,8 @@ function drawAudioLevelCanvas(id, audioLevel) {
|
||||||
|
|
||||||
if (shadowLevel > 0) {
|
if (shadowLevel > 0) {
|
||||||
// drawContext, x, y, w, h, r, shadowColor, shadowLevel
|
// drawContext, x, y, w, h, r, shadowColor, shadowLevel
|
||||||
CanvasUtil.drawRoundRectGlow(drawContext,
|
CanvasUtil.drawRoundRectGlow(
|
||||||
|
drawContext,
|
||||||
interfaceConfig.CANVAS_EXTRA / 2, interfaceConfig.CANVAS_EXTRA / 2,
|
interfaceConfig.CANVAS_EXTRA / 2, interfaceConfig.CANVAS_EXTRA / 2,
|
||||||
canvas.width - interfaceConfig.CANVAS_EXTRA,
|
canvas.width - interfaceConfig.CANVAS_EXTRA,
|
||||||
canvas.height - interfaceConfig.CANVAS_EXTRA,
|
canvas.height - interfaceConfig.CANVAS_EXTRA,
|
||||||
|
@ -88,11 +90,14 @@ function getShadowLevel (audioLevel) {
|
||||||
let shadowLevel = 0;
|
let shadowLevel = 0;
|
||||||
|
|
||||||
if (audioLevel <= 0.3) {
|
if (audioLevel <= 0.3) {
|
||||||
shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*(audioLevel/0.3));
|
shadowLevel
|
||||||
|
= Math.round(interfaceConfig.CANVAS_EXTRA/2*(audioLevel/0.3));
|
||||||
} else if (audioLevel <= 0.6) {
|
} else if (audioLevel <= 0.6) {
|
||||||
shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.3) / 0.3));
|
shadowLevel
|
||||||
|
= Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.3) / 0.3));
|
||||||
} else {
|
} else {
|
||||||
shadowLevel = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.6) / 0.4));
|
shadowLevel
|
||||||
|
= Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.6) / 0.4));
|
||||||
}
|
}
|
||||||
|
|
||||||
return shadowLevel;
|
return shadowLevel;
|
||||||
|
@ -203,7 +208,8 @@ const AudioLevels = {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDominantSpeakerAudioLevel (audioLevel) {
|
updateDominantSpeakerAudioLevel (audioLevel) {
|
||||||
if($("#domiantSpeaker").css("visibility") == "hidden" || ASDrawContext === null) {
|
if($("#dominantSpeaker").css("visibility") == "hidden"
|
||||||
|
|| ASDrawContext === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +220,6 @@ const AudioLevels = {
|
||||||
|
|
||||||
ASDrawContext.shadowBlur = getShadowLevel(audioLevel);
|
ASDrawContext.shadowBlur = getShadowLevel(audioLevel);
|
||||||
|
|
||||||
|
|
||||||
// Fill the shape.
|
// Fill the shape.
|
||||||
ASDrawContext.fill();
|
ASDrawContext.fill();
|
||||||
},
|
},
|
||||||
|
@ -223,7 +228,10 @@ const AudioLevels = {
|
||||||
let canvasWidth = thumbWidth + interfaceConfig.CANVAS_EXTRA;
|
let canvasWidth = thumbWidth + interfaceConfig.CANVAS_EXTRA;
|
||||||
let canvasHeight = thumbHeight + interfaceConfig.CANVAS_EXTRA;
|
let canvasHeight = thumbHeight + interfaceConfig.CANVAS_EXTRA;
|
||||||
|
|
||||||
BottomToolbar.getThumbs().children('canvas').width(canvasWidth).height(canvasHeight);
|
BottomToolbar.getThumbs().children('canvas').each(function () {
|
||||||
|
$(this).attr('width', canvasWidth);
|
||||||
|
$(this).attr('height', canvasHeight);
|
||||||
|
});
|
||||||
|
|
||||||
Object.keys(audioLevelCanvasCache).forEach(function (id) {
|
Object.keys(audioLevelCanvasCache).forEach(function (id) {
|
||||||
audioLevelCanvasCache[id].width = canvasWidth;
|
audioLevelCanvasCache[id].width = canvasWidth;
|
||||||
|
|
|
@ -424,7 +424,8 @@ export default class LargeVideoManager {
|
||||||
this.videoContainer.showAvatar(isVideoMuted);
|
this.videoContainer.showAvatar(isVideoMuted);
|
||||||
|
|
||||||
// do not show stream if video is muted
|
// do not show stream if video is muted
|
||||||
let promise = isVideoMuted ? Promise.resolve() : this.videoContainer.show();
|
let promise
|
||||||
|
= isVideoMuted ? Promise.resolve() : this.videoContainer.show();
|
||||||
|
|
||||||
// resolve updateLargeVideo promise after everything is done
|
// resolve updateLargeVideo promise after everything is done
|
||||||
promise.then(resolve);
|
promise.then(resolve);
|
||||||
|
|
|
@ -150,7 +150,8 @@ var VideoLayout = {
|
||||||
this.onVideoTypeChanged(localId, stream.videoType);
|
this.onVideoTypeChanged(localId, stream.videoType);
|
||||||
|
|
||||||
let {thumbWidth, thumbHeight} = this.calculateThumbnailSize();
|
let {thumbWidth, thumbHeight} = this.calculateThumbnailSize();
|
||||||
AudioLevels.updateAudioLevelCanvas(null, thumbWidth, thumbHeight);
|
AudioLevels.updateAudioLevelCanvas(
|
||||||
|
null, thumbWidth, thumbHeight);
|
||||||
|
|
||||||
if (!stream.isMuted()) {
|
if (!stream.isMuted()) {
|
||||||
localVideoThumbnail.changeVideo(stream);
|
localVideoThumbnail.changeVideo(stream);
|
||||||
|
|
Loading…
Reference in New Issue