Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
7e9a64d7c1

+ 2
- 1
lang/main.json Parādīt failu

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

+ 34
- 8
react/features/video-quality/components/VideoQualityLabel.web.js Parādīt failu

@@ -4,6 +4,8 @@ import React, { Component } from 'react';
4 4
 import { connect } from 'react-redux';
5 5
 
6 6
 import { translate } from '../../base/i18n';
7
+import { MEDIA_TYPE } from '../../base/media';
8
+import { getTrackByMediaTypeAndParticipant } from '../../base/tracks';
7 9
 
8 10
 /**
9 11
  * A map of video resolution (number) to translation key.
@@ -62,6 +64,11 @@ export class VideoQualityLabel extends Component {
62 64
          */
63 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 73
          * Invoked to obtain translated strings.
67 74
          */
@@ -116,6 +123,7 @@ export class VideoQualityLabel extends Component {
116 123
             _conferenceStarted,
117 124
             _filmstripVisible,
118 125
             _resolution,
126
+            _videoTrack,
119 127
             t
120 128
         } = this.props;
121 129
 
@@ -134,8 +142,21 @@ export class VideoQualityLabel extends Component {
134 142
         const opening = this.state.togglingToVisible ? 'opening' : '';
135 143
         const classNames
136 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 161
         return (
141 162
             <div
@@ -145,9 +166,7 @@ export class VideoQualityLabel extends Component {
145 166
                     description = { t(tooltipKey) }
146 167
                     position = { 'left' }>
147 168
                     <div className = 'video-quality-label-status'>
148
-                        { _audioOnly
149
-                            ? <i className = 'icon-visibility-off' />
150
-                            : this._mapResolutionToTranslation(_resolution) }
169
+                        { labelContent }
151 170
                     </div>
152 171
                 </Tooltip>
153 172
             </div>
@@ -194,19 +213,26 @@ export class VideoQualityLabel extends Component {
194 213
  *     _audioOnly: boolean,
195 214
  *     _conferenceStarted: boolean,
196 215
  *     _filmstripVisible: true,
197
- *     _resolution: number
216
+ *     _resolution: number,
217
+ *     _videoTrack: Object
198 218
  * }}
199 219
  */
200 220
 function _mapStateToProps(state) {
201 221
     const { audioOnly, conference } = state['features/base/conference'];
202 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 230
     return {
206 231
         _audioOnly: audioOnly,
207 232
         _conferenceStarted: Boolean(conference),
208 233
         _filmstripVisible: visible,
209
-        _resolution: resolution
234
+        _resolution: resolution,
235
+        _videoTrack: videoTrackOnLargeVideo
210 236
     };
211 237
 }
212 238
 

Notiek ielāde…
Atcelt
Saglabāt