snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
Some checks failed
Prosody Plugin Tests / test (push) Failing after 10m11s
Close stale issues and PRs / stale (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-15 15:56:32 +05:00
commit 1d2bfcac0c
3159 changed files with 464524 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { VIDEO_QUALITY_LEVELS } from '../../video-quality/constants';
/**
* Determines the lastN value to be used for the conference based on the video quality selected.
*
* @param {string} qualityLevel - Quality level (height) selected.
* @param {number} channelLastN - LastN value set for the whole conference.
* @returns {number} LastN value applicable to the quality level specified.
*/
export function getLastNForQualityLevel(qualityLevel: number, channelLastN: number) {
let lastN = channelLastN;
const videoQualityLevels = Object.values(VIDEO_QUALITY_LEVELS);
for (const lvl in videoQualityLevels) {
if (videoQualityLevels.hasOwnProperty(lvl)
&& qualityLevel === videoQualityLevels[lvl]
&& Number(lvl) > 1) {
lastN = Math.floor(channelLastN / Math.pow(2, Number(lvl) - 1));
}
}
return lastN;
}