Przeglądaj źródła

fix(dominant-label) Fix dominant speaker stage view label (#11071)

Move label to LargeVideo so that's it's centred in the view instead of the whole screen
Move vertical filmstrip max width calculation to a function and use it to set the large video width
master
Robert Pintilii 3 lat temu
rodzic
commit
2863b05f37
No account linked to committer's email address

+ 2
- 2
modules/UI/videolayout/LargeVideoManager.js Wyświetl plik

@@ -26,7 +26,7 @@ import {
26 26
     isTrackStreamingStatusInactive,
27 27
     isTrackStreamingStatusInterrupted
28 28
 } from '../../../react/features/connection-indicator/functions';
29
-import { FILMSTRIP_BREAKPOINT, isFilmstripResizable } from '../../../react/features/filmstrip';
29
+import { FILMSTRIP_BREAKPOINT, isFilmstripResizable, getVerticalViewMaxWidth } from '../../../react/features/filmstrip';
30 30
 import {
31 31
     updateKnownLargeVideoResolution
32 32
 } from '../../../react/features/large-video/actions';
@@ -419,7 +419,7 @@ export default class LargeVideoManager {
419 419
         }
420 420
 
421 421
         if (resizableFilmstrip && visible && filmstripWidth.current >= FILMSTRIP_BREAKPOINT) {
422
-            widthToUse -= filmstripWidth.current;
422
+            widthToUse -= getVerticalViewMaxWidth(state);
423 423
         }
424 424
 
425 425
         this.width = widthToUse;

+ 10
- 5
react/features/display-name/components/web/DominantSpeakerName.js Wyświetl plik

@@ -18,13 +18,18 @@ const useStyles = makeStyles(theme => {
18 18
         badgeContainer: {
19 19
             ...withPixelLineHeight(theme.typography.bodyShortRegularLarge),
20 20
             alignItems: 'center',
21
-            display: 'flex',
21
+            display: 'inline-flex',
22 22
             justifyContent: 'center',
23
-            marginBottom: theme.spacing(2),
24
-            transition: 'margin-bottom 0.3s'
23
+            marginBottom: theme.spacing(7),
24
+            transition: 'margin-bottom 0.3s',
25
+            position: 'absolute',
26
+            bottom: 0,
27
+            left: 0,
28
+            width: '100%',
29
+            zIndex: 1
25 30
         },
26 31
         containerElevated: {
27
-            marginBottom: theme.spacing(7)
32
+            marginBottom: theme.spacing(12)
28 33
         }
29 34
     };
30 35
 });
@@ -50,7 +55,7 @@ const DominantSpeakerName = () => {
50 55
     if (showDisplayName && nameToDisplay && selectedId !== localId && !isTileView) {
51 56
         return (
52 57
             <div
53
-                className = { `${classes.badgeContainer}${toolboxVisible ? '' : ` ${classes.containerElevated}`}` }>
58
+                className = { `${classes.badgeContainer}${toolboxVisible ? ` ${classes.containerElevated}` : ''}` }>
54 59
                 <DisplayNameBadge name = { nameToDisplay } />
55 60
             </div>
56 61
         );

+ 10
- 11
react/features/filmstrip/components/web/Filmstrip.js Wyświetl plik

@@ -34,6 +34,7 @@ import {
34 34
     TOOLBAR_HEIGHT_MOBILE
35 35
 } from '../../constants';
36 36
 import {
37
+    getVerticalViewMaxWidth,
37 38
     isFilmstripResizable,
38 39
     shouldRemoteVideosBeVisible,
39 40
     showGridInVerticalView
@@ -152,6 +153,11 @@ type Props = {
152 153
      */
153 154
     _verticalViewGrid: boolean,
154 155
 
156
+    /**
157
+     * The max width of the vertical filmstrip.
158
+     */
159
+    _verticalViewMaxWidth: number,
160
+
155 161
     /**
156 162
      * Additional CSS class names to add to the container of all the thumbnails.
157 163
      */
@@ -285,23 +291,15 @@ class Filmstrip extends PureComponent <Props, State> {
285 291
             _verticalFilmstripWidth,
286 292
             _visible,
287 293
             _verticalViewGrid,
294
+            _verticalViewMaxWidth,
288 295
             classes
289 296
         } = this.props;
290 297
         const { isMouseDown } = this.state;
291 298
         const tileViewActive = _currentLayout === LAYOUTS.TILE_VIEW;
292
-        let maxWidth;
293 299
 
294 300
         switch (_currentLayout) {
295 301
         case LAYOUTS.VERTICAL_FILMSTRIP_VIEW:
296
-            maxWidth = _resizableFilmstrip
297
-                ? _verticalFilmstripWidth || DEFAULT_FILMSTRIP_WIDTH
298
-                : interfaceConfig.FILM_STRIP_MAX_HEIGHT || DEFAULT_FILMSTRIP_WIDTH;
299
-
300
-            // Adding 4px for the border-right and margin-right.
301
-            // On non-resizable filmstrip add 4px for the left margin and border.
302
-            // Also adding 7px for the scrollbar. Also adding 9px for the drag handle.
303
-            filmstripStyle.maxWidth = maxWidth + (_verticalViewGrid ? 0 : 11) + (_resizableFilmstrip ? 9 : 4);
304
-
302
+            filmstripStyle.maxWidth = _verticalViewMaxWidth;
305 303
             if (!_visible) {
306 304
                 filmstripStyle.right = `-${filmstripStyle.maxWidth}px`;
307 305
             }
@@ -850,7 +848,8 @@ function _mapStateToProps(state) {
850 848
         _verticalFilmstripWidth: verticalFilmstripWidth.current,
851 849
         _videosClassName: videosClassName,
852 850
         _visible: visible,
853
-        _verticalViewGrid
851
+        _verticalViewGrid,
852
+        _verticalViewMaxWidth: getVerticalViewMaxWidth(state)
854 853
     };
855 854
 }
856 855
 

+ 22
- 0
react/features/filmstrip/functions.web.js Wyświetl plik

@@ -401,3 +401,25 @@ export function showGridInVerticalView(state) {
401 401
 
402 402
     return resizableFilmstrip && ((width.current ?? 0) > FILMSTRIP_GRID_BREAKPOINT);
403 403
 }
404
+
405
+/**
406
+ * Gets the vertical filmstrip max width.
407
+ *
408
+ * @param {Object} state - Redux state.
409
+ * @returns {number}
410
+ */
411
+export function getVerticalViewMaxWidth(state) {
412
+    const { width } = state['features/filmstrip'];
413
+    const _resizableFilmstrip = isFilmstripResizable(state);
414
+    const _verticalViewGrid = showGridInVerticalView(state);
415
+    let maxWidth = _resizableFilmstrip
416
+        ? width.current || DEFAULT_FILMSTRIP_WIDTH
417
+        : interfaceConfig.FILM_STRIP_MAX_HEIGHT || DEFAULT_FILMSTRIP_WIDTH;
418
+
419
+    // Adding 4px for the border-right and margin-right.
420
+    // On non-resizable filmstrip add 4px for the left margin and border.
421
+    // Also adding 7px for the scrollbar. Also adding 9px for the drag handle.
422
+    maxWidth += (_verticalViewGrid ? 0 : 11) + (_resizableFilmstrip ? 9 : 4);
423
+
424
+    return maxWidth;
425
+}

+ 20
- 2
react/features/large-video/components/LargeVideo.web.js Wyświetl plik

@@ -6,7 +6,9 @@ import VideoLayout from '../../../../modules/UI/videolayout/VideoLayout';
6 6
 import { Watermarks } from '../../base/react';
7 7
 import { connect } from '../../base/redux';
8 8
 import { setColorAlpha } from '../../base/util';
9
+import { DominantSpeakerName } from '../../display-name';
9 10
 import { FILMSTRIP_BREAKPOINT, isFilmstripResizable } from '../../filmstrip';
11
+import { getVerticalViewMaxWidth } from '../../filmstrip/functions.web';
10 12
 import { SharedVideo } from '../../shared-video/components/web';
11 13
 import { Captions } from '../../subtitles/';
12 14
 import { setTileView } from '../../video-layout/actions';
@@ -46,11 +48,21 @@ type Props = {
46 48
      */
47 49
     _resizableFilmstrip: boolean,
48 50
 
51
+    /**
52
+     * Whether or not to show dominant speaker badge.
53
+     */
54
+    _showDominantSpeakerBadge: boolean,
55
+
49 56
     /**
50 57
      * The width of the vertical filmstrip (user resized).
51 58
      */
52 59
     _verticalFilmstripWidth: ?number,
53 60
 
61
+    /**
62
+     * The max width of the vertical filmstrip.
63
+     */
64
+    _verticalViewMaxWidth: number,
65
+
54 66
     /**
55 67
      * Whether or not the filmstrip is visible.
56 68
      */
@@ -113,7 +125,8 @@ class LargeVideo extends Component<Props> {
113 125
     render() {
114 126
         const {
115 127
             _isChatOpen,
116
-            _noAutoPlayVideo
128
+            _noAutoPlayVideo,
129
+            _showDominantSpeakerBadge
117 130
         } = this.props;
118 131
         const style = this._getCustomSyles();
119 132
         const className = `videocontainer${_isChatOpen ? ' shift-right' : ''}`;
@@ -162,6 +175,7 @@ class LargeVideo extends Component<Props> {
162 175
                 </div>
163 176
                 { interfaceConfig.DISABLE_TRANSCRIPTION_SUBTITLES
164 177
                     || <Captions /> }
178
+                {_showDominantSpeakerBadge && <DominantSpeakerName />}
165 179
             </div>
166 180
         );
167 181
     }
@@ -217,6 +231,7 @@ class LargeVideo extends Component<Props> {
217 231
             _customBackgroundColor,
218 232
             _customBackgroundImageUrl,
219 233
             _verticalFilmstripWidth,
234
+            _verticalViewMaxWidth,
220 235
             _visibleFilmstrip
221 236
         } = this.props;
222 237
 
@@ -234,7 +249,7 @@ class LargeVideo extends Component<Props> {
234 249
         }
235 250
 
236 251
         if (_visibleFilmstrip && _verticalFilmstripWidth >= FILMSTRIP_BREAKPOINT) {
237
-            styles.width = `calc(100% - ${_verticalFilmstripWidth || 0}px)`;
252
+            styles.width = `calc(100% - ${_verticalViewMaxWidth || 0}px)`;
238 253
         }
239 254
 
240 255
         return styles;
@@ -275,6 +290,7 @@ function _mapStateToProps(state) {
275 290
     const { backgroundColor, backgroundImageUrl } = state['features/dynamic-branding'];
276 291
     const { isOpen: isChatOpen } = state['features/chat'];
277 292
     const { width: verticalFilmstripWidth, visible } = state['features/filmstrip'];
293
+    const { hideDominantSpeakerBadge } = state['features/base/config'];
278 294
 
279 295
     return {
280 296
         _backgroundAlpha: state['features/base/config'].backgroundAlpha,
@@ -283,7 +299,9 @@ function _mapStateToProps(state) {
283 299
         _isChatOpen: isChatOpen,
284 300
         _noAutoPlayVideo: testingConfig?.noAutoPlayVideo,
285 301
         _resizableFilmstrip: isFilmstripResizable(state),
302
+        _showDominantSpeakerBadge: !hideDominantSpeakerBadge,
286 303
         _verticalFilmstripWidth: verticalFilmstripWidth.current,
304
+        _verticalViewMaxWidth: getVerticalViewMaxWidth(state),
287 305
         _visibleFilmstrip: visible
288 306
     };
289 307
 }

+ 0
- 11
react/features/toolbox/components/web/Toolbox.js Wyświetl plik

@@ -27,7 +27,6 @@ import { connect } from '../../../base/redux';
27 27
 import { getLocalVideoTrack } from '../../../base/tracks';
28 28
 import { toggleChat } from '../../../chat';
29 29
 import { ChatButton } from '../../../chat/components';
30
-import { DominantSpeakerName } from '../../../display-name';
31 30
 import { EmbedMeetingButton } from '../../../embed-meeting';
32 31
 import { SharedDocumentButton } from '../../../etherpad';
33 32
 import { FeedbackButton } from '../../../feedback';
@@ -225,11 +224,6 @@ type Props = {
225 224
      */
226 225
     _sharingVideo: boolean,
227 226
 
228
-    /**
229
-     * Whether or not to show dominant speaker badge.
230
-     */
231
-    _showDominantSpeakerBadge: boolean,
232
-
233 227
     /**
234 228
      * Whether or not the tile view is enabled.
235 229
      */
@@ -1267,7 +1261,6 @@ class Toolbox extends Component<Props> {
1267 1261
             _overflowMenuVisible,
1268 1262
             _reactionsEnabled,
1269 1263
             _toolbarButtons,
1270
-            _showDominantSpeakerBadge,
1271 1264
             classes,
1272 1265
             t
1273 1266
         } = this.props;
@@ -1287,8 +1280,6 @@ class Toolbox extends Component<Props> {
1287 1280
                         onMouseOver: this._onMouseOver
1288 1281
                     }) }>
1289 1282
 
1290
-                    { _showDominantSpeakerBadge && <DominantSpeakerName /> }
1291
-
1292 1283
                     <div className = 'toolbox-content-items'>
1293 1284
                         {mainMenuButtons.map(({ Content, key, ...rest }) => Content !== Separator && (
1294 1285
                             <Content
@@ -1359,7 +1350,6 @@ function _mapStateToProps(state, ownProps) {
1359 1350
         callStatsID,
1360 1351
         disableProfile,
1361 1352
         enableFeaturesBasedOnToken,
1362
-        hideDominantSpeakerBadge,
1363 1353
         iAmRecorder,
1364 1354
         iAmSipGateway
1365 1355
     } = state['features/base/config'];
@@ -1417,7 +1407,6 @@ function _mapStateToProps(state, ownProps) {
1417 1407
         _raisedHand: hasRaisedHand(localParticipant),
1418 1408
         _reactionsEnabled: isReactionsEnabled(state),
1419 1409
         _screenSharing: isScreenVideoShared(state),
1420
-        _showDominantSpeakerBadge: !hideDominantSpeakerBadge,
1421 1410
         _tileViewEnabled: shouldDisplayTileView(state),
1422 1411
         _toolbarButtons: toolbarButtons,
1423 1412
         _virtualSource: state['features/virtual-background'].virtualSource,

Ładowanie…
Anuluj
Zapisz