Apply suggestions from code review
Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
@@ -36,14 +36,14 @@ export function getVideoQualityOptions(options) {
|
||||
qualityOptions.push(autoQualityOption);
|
||||
}
|
||||
|
||||
if (videoBitRate > 0 && videoBitRate < 120000000) {
|
||||
if (videoBitRate > 0 && videoBitRate < bitrateConfigurations[0].bitrate) {
|
||||
// Push one entry that has higher limit than video bitrate to allow using source bitrate when Auto is also limited
|
||||
const sourceOptions = minBy(bitrateConfigurations.filter((c) => c.bitrate > videoBitRate), (x) => x.bitrate);
|
||||
qualityOptions.push(sourceOptions);
|
||||
}
|
||||
|
||||
bitrateConfigurations.forEach((c) => {
|
||||
if (videoBitRate < 0 || (videoBitRate > 0 && c.bitrate < videoBitRate)) {
|
||||
if (videoBitRate <= 0 || c.bitrate <= videoBitRate) {
|
||||
qualityOptions.push(c);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user