浏览代码

fix(video-quality): different tooltips for different definitions

master
Leonard Kim 7 年前
父节点
当前提交
10c8d380b7
共有 2 个文件被更改,包括 18 次插入7 次删除
  1. 3
    0
      lang/main.json
  2. 15
    7
      react/features/video-quality/components/VideoQualityLabel.web.js

+ 3
- 0
lang/main.json 查看文件

451
     "videoStatus": {
451
     "videoStatus": {
452
         "callQuality": "Call Quality",
452
         "callQuality": "Call Quality",
453
         "hd": "HD",
453
         "hd": "HD",
454
+        "hdTooltip": "Viewing high definition video",
454
         "highDefinition": "High definition",
455
         "highDefinition": "High definition",
455
         "labelTooltipAudioOnly":  "Audio-only mode enabled",
456
         "labelTooltipAudioOnly":  "Audio-only mode enabled",
456
         "labelTooiltipNoVideo": "No video",
457
         "labelTooiltipNoVideo": "No video",
457
         "labelTooltipVideo": "Current video quality",
458
         "labelTooltipVideo": "Current video quality",
458
         "ld": "LD",
459
         "ld": "LD",
460
+        "ldTooltip": "Viewing low definition video",
459
         "lowDefinition": "Low definition",
461
         "lowDefinition": "Low definition",
460
         "onlyAudioAvailable": "Only audio is available",
462
         "onlyAudioAvailable": "Only audio is available",
461
         "onlyAudioSupported": "We only support audio in this browser.",
463
         "onlyAudioSupported": "We only support audio in this browser.",
463
         "p2pVideoQualityDescription": "In peer to peer mode, received call quality can only be toggled between high and audio only. Other settings will not be honored until peer to peer is exited.",
465
         "p2pVideoQualityDescription": "In peer to peer mode, received call quality can only be toggled between high and audio only. Other settings will not be honored until peer to peer is exited.",
464
         "recHighDefinitionOnly": "Will prefer high definition.",
466
         "recHighDefinitionOnly": "Will prefer high definition.",
465
         "sd": "SD",
467
         "sd": "SD",
468
+        "sdTooltip": "Viewing standard definition video",
466
         "standardDefinition": "Standard definition",
469
         "standardDefinition": "Standard definition",
467
         "qualityButtonTip": "Change received video quality"
470
         "qualityButtonTip": "Change received video quality"
468
     },
471
     },

+ 15
- 7
react/features/video-quality/components/VideoQualityLabel.web.js 查看文件

153
             labelContent = <i className = 'icon-visibility-off' />;
153
             labelContent = <i className = 'icon-visibility-off' />;
154
             tooltipKey = 'videoStatus.labelTooiltipNoVideo';
154
             tooltipKey = 'videoStatus.labelTooiltipNoVideo';
155
         } else {
155
         } else {
156
-            labelContent = this._mapResolutionToTranslation(_resolution);
157
-            tooltipKey = 'videoStatus.labelTooltipVideo';
156
+            const translationKeys
157
+                = this._mapResolutionToTranslationsKeys(_resolution);
158
+
159
+            labelContent = t(translationKeys.labelKey);
160
+            tooltipKey = translationKeys.tooltipKey;
158
         }
161
         }
159
 
162
 
160
 
163
 
174
     }
177
     }
175
 
178
 
176
     /**
179
     /**
177
-     * Matches the passed in resolution with a translation key for describing
180
+     * Matches the passed in resolution with a translation keys for describing
178
      * the resolution. The passed in resolution will be matched with a known
181
      * the resolution. The passed in resolution will be matched with a known
179
      * resolution that it is at least greater than or equal to.
182
      * resolution that it is at least greater than or equal to.
180
      *
183
      *
181
      * @param {number} resolution - The video height to match with a
184
      * @param {number} resolution - The video height to match with a
182
      * translation.
185
      * translation.
183
      * @private
186
      * @private
184
-     * @returns {string}
187
+     * @returns {Object}
185
      */
188
      */
186
-    _mapResolutionToTranslation(resolution) {
189
+    _mapResolutionToTranslationsKeys(resolution) {
187
         // Set the default matching resolution of the lowest just in case a
190
         // Set the default matching resolution of the lowest just in case a
188
         // match is not found.
191
         // match is not found.
189
         let highestMatchingResolution = RESOLUTIONS[0];
192
         let highestMatchingResolution = RESOLUTIONS[0];
198
             }
201
             }
199
         }
202
         }
200
 
203
 
201
-        return this.props.t(
202
-            RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution]);
204
+        const labelKey
205
+            = RESOLUTION_TO_TRANSLATION_KEY[highestMatchingResolution];
206
+
207
+        return {
208
+            labelKey,
209
+            tooltipKey: `${labelKey}Tooltip`
210
+        };
203
     }
211
     }
204
 }
212
 }
205
 
213
 

正在加载...
取消
保存