Ver código fonte

fix(quality-label): show eye icon when for muted video

Instead of continuing with HD/SD/LD, show the eye icon
for when the participant on large video is muted or has
no video.
master
Leonard Kim 7 anos atrás
pai
commit
7e9a64d7c1

+ 2
- 1
lang/main.json Ver arquivo

452
         "callQuality": "Call Quality",
452
         "callQuality": "Call Quality",
453
         "hd": "HD",
453
         "hd": "HD",
454
         "highDefinition": "High definition",
454
         "highDefinition": "High definition",
455
-        "labelTooltipVideo": "Current video quality",
456
         "labelTooltipAudioOnly":  "Audio-only mode enabled",
455
         "labelTooltipAudioOnly":  "Audio-only mode enabled",
456
+        "labelTooiltipNoVideo": "No video",
457
+        "labelTooltipVideo": "Current video quality",
457
         "ld": "LD",
458
         "ld": "LD",
458
         "lowDefinition": "Low definition",
459
         "lowDefinition": "Low definition",
459
         "onlyAudioAvailable": "Only audio is available",
460
         "onlyAudioAvailable": "Only audio is available",

+ 34
- 8
react/features/video-quality/components/VideoQualityLabel.web.js Ver arquivo

4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
 import { translate } from '../../base/i18n';
6
 import { translate } from '../../base/i18n';
7
+import { MEDIA_TYPE } from '../../base/media';
8
+import { getTrackByMediaTypeAndParticipant } from '../../base/tracks';
7
 
9
 
8
 /**
10
 /**
9
  * A map of video resolution (number) to translation key.
11
  * A map of video resolution (number) to translation key.
62
          */
64
          */
63
         _resolution: PropTypes.number,
65
         _resolution: PropTypes.number,
64
 
66
 
67
+        /**
68
+         * The redux representation of the JitsiTrack displayed on large video.
69
+         */
70
+        _videoTrack: PropTypes.object,
71
+
65
         /**
72
         /**
66
          * Invoked to obtain translated strings.
73
          * Invoked to obtain translated strings.
67
          */
74
          */
116
             _conferenceStarted,
123
             _conferenceStarted,
117
             _filmstripVisible,
124
             _filmstripVisible,
118
             _resolution,
125
             _resolution,
126
+            _videoTrack,
119
             t
127
             t
120
         } = this.props;
128
         } = this.props;
121
 
129
 
134
         const opening = this.state.togglingToVisible ? 'opening' : '';
142
         const opening = this.state.togglingToVisible ? 'opening' : '';
135
         const classNames
143
         const classNames
136
             = `${baseClasses} ${filmstrip} ${opening}`;
144
             = `${baseClasses} ${filmstrip} ${opening}`;
137
-        const tooltipKey
138
-            = `videoStatus.labelTooltip${_audioOnly ? 'AudioOnly' : 'Video'}`;
145
+
146
+        let labelContent;
147
+        let tooltipKey;
148
+
149
+        if (_audioOnly) {
150
+            labelContent = <i className = 'icon-visibility-off' />;
151
+            tooltipKey = 'videoStatus.labelTooltipAudioOnly';
152
+        } else if (!_videoTrack || _videoTrack.muted) {
153
+            labelContent = <i className = 'icon-visibility-off' />;
154
+            tooltipKey = 'videoStatus.labelTooiltipNoVideo';
155
+        } else {
156
+            labelContent = this._mapResolutionToTranslation(_resolution);
157
+            tooltipKey = 'videoStatus.labelTooltipVideo';
158
+        }
159
+
139
 
160
 
140
         return (
161
         return (
141
             <div
162
             <div
145
                     description = { t(tooltipKey) }
166
                     description = { t(tooltipKey) }
146
                     position = { 'left' }>
167
                     position = { 'left' }>
147
                     <div className = 'video-quality-label-status'>
168
                     <div className = 'video-quality-label-status'>
148
-                        { _audioOnly
149
-                            ? <i className = 'icon-visibility-off' />
150
-                            : this._mapResolutionToTranslation(_resolution) }
169
+                        { labelContent }
151
                     </div>
170
                     </div>
152
                 </Tooltip>
171
                 </Tooltip>
153
             </div>
172
             </div>
194
  *     _audioOnly: boolean,
213
  *     _audioOnly: boolean,
195
  *     _conferenceStarted: boolean,
214
  *     _conferenceStarted: boolean,
196
  *     _filmstripVisible: true,
215
  *     _filmstripVisible: true,
197
- *     _resolution: number
216
+ *     _resolution: number,
217
+ *     _videoTrack: Object
198
  * }}
218
  * }}
199
  */
219
  */
200
 function _mapStateToProps(state) {
220
 function _mapStateToProps(state) {
201
     const { audioOnly, conference } = state['features/base/conference'];
221
     const { audioOnly, conference } = state['features/base/conference'];
202
     const { visible } = state['features/filmstrip'];
222
     const { visible } = state['features/filmstrip'];
203
-    const { resolution } = state['features/large-video'];
223
+    const { resolution, participantId } = state['features/large-video'];
224
+    const videoTrackOnLargeVideo = getTrackByMediaTypeAndParticipant(
225
+        state['features/base/tracks'],
226
+        MEDIA_TYPE.VIDEO,
227
+        participantId
228
+    );
204
 
229
 
205
     return {
230
     return {
206
         _audioOnly: audioOnly,
231
         _audioOnly: audioOnly,
207
         _conferenceStarted: Boolean(conference),
232
         _conferenceStarted: Boolean(conference),
208
         _filmstripVisible: visible,
233
         _filmstripVisible: visible,
209
-        _resolution: resolution
234
+        _resolution: resolution,
235
+        _videoTrack: videoTrackOnLargeVideo
210
     };
236
     };
211
 }
237
 }
212
 
238
 

Carregando…
Cancelar
Salvar