Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(1080p): video quality label shows hd at 720 (#2131)

virtuacoplenny6cda93d3c170
diff --git a/react/features/video-quality/components/VideoQualityLabel.web.js b/react/features/video-quality/components/VideoQualityLabel.web.js
index 55ea650c1a..8fe06a9c11 100644
--- a/react/features/video-quality/components/VideoQualityLabel.web.js
+++ b/react/features/video-quality/components/VideoQualityLabel.web.js
@@ -3,10 +3,18 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
-import { VIDEO_QUALITY_LEVELS } from '../../base/conference';
import { translate } from '../../base/i18n';
-const { HIGH, STANDARD, LOW } = VIDEO_QUALITY_LEVELS;
+/**
+ * A map of video resolution (number) to translation key.
+ *
+ * @type {Object}
+ */
+const RESOLUTION_TO_TRANSLATION_KEY = {
+ 720: 'videoStatus.hd',
+ 360: 'videoStatus.sd',
+ 180: 'videoStatus.ld'
+};
/**
* Expected video resolutions placed into an array, sorted from lowest to
@@ -15,18 +23,9 @@ const { HIGH, STANDARD, LOW } = VIDEO_QUALITY_LEVELS;
* @type {number[]}
*/
const RESOLUTIONS
- = Object.values(VIDEO_QUALITY_LEVELS).sort((a, b) => a - b);
-
-/**
- * A map of video resolution (number) to translation key.
- *
- * @type {Object}
- */
-const RESOLUTION_TO_TRANSLATION_KEY = {
- [HIGH]: 'videoStatus.hd',
- [STANDARD]: 'videoStatus.sd',
- [LOW]: 'videoStatus.ld'
-};
+ = Object.keys(RESOLUTION_TO_TRANSLATION_KEY)
+ .map(resolution => parseInt(resolution, 10))
+ .sort((a, b) => a - b);
/**
* React {@code Component} responsible for displaying a label that indicates