Browse Source

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

The minimum resolution needed to show the HD label should be
720, not 1080. However, the requested video quality for
high quality should be 1080.
master
virtuacoplenny 8 years ago
parent
commit
6cda93d3c1
1 changed files with 13 additions and 14 deletions
  1. 13
    14
      react/features/video-quality/components/VideoQualityLabel.web.js

+ 13
- 14
react/features/video-quality/components/VideoQualityLabel.web.js View File

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
-import { VIDEO_QUALITY_LEVELS } from '../../base/conference';
7
 import { translate } from '../../base/i18n';
6
 import { translate } from '../../base/i18n';
8
 
7
 
9
-const { HIGH, STANDARD, LOW } = VIDEO_QUALITY_LEVELS;
8
+/**
9
+ * A map of video resolution (number) to translation key.
10
+ *
11
+ * @type {Object}
12
+ */
13
+const RESOLUTION_TO_TRANSLATION_KEY = {
14
+    720: 'videoStatus.hd',
15
+    360: 'videoStatus.sd',
16
+    180: 'videoStatus.ld'
17
+};
10
 
18
 
11
 /**
19
 /**
12
  * Expected video resolutions placed into an array, sorted from lowest to
20
  * Expected video resolutions placed into an array, sorted from lowest to
15
  * @type {number[]}
23
  * @type {number[]}
16
  */
24
  */
17
 const RESOLUTIONS
25
 const RESOLUTIONS
18
-    = Object.values(VIDEO_QUALITY_LEVELS).sort((a, b) => a - b);
19
-
20
-/**
21
- * A map of video resolution (number) to translation key.
22
- *
23
- * @type {Object}
24
- */
25
-const RESOLUTION_TO_TRANSLATION_KEY = {
26
-    [HIGH]: 'videoStatus.hd',
27
-    [STANDARD]: 'videoStatus.sd',
28
-    [LOW]: 'videoStatus.ld'
29
-};
26
+    = Object.keys(RESOLUTION_TO_TRANSLATION_KEY)
27
+        .map(resolution => parseInt(resolution, 10))
28
+        .sort((a, b) => a - b);
30
 
29
 
31
 /**
30
 /**
32
  * React {@code Component} responsible for displaying a label that indicates
31
  * React {@code Component} responsible for displaying a label that indicates

Loading…
Cancel
Save