Browse Source

fix(responsive-ui): Shrink self view when in portrait mode on mobile web

master
Vlad Piersec 4 years ago
parent
commit
0a9b9bb41d

+ 12
- 0
css/filmstrip/_vertical_filmstrip_overrides.scss View File

84
         margin-bottom: 3px;
84
         margin-bottom: 3px;
85
         margin-left: $remoteVideoMenuIconMargin;
85
         margin-left: $remoteVideoMenuIconMargin;
86
     }
86
     }
87
+
88
+    .self-view-mobile-portrait video {
89
+        object-fit: contain;
90
+    }
87
 }
91
 }
88
 
92
 
89
 /**
93
 /**
112
         transition-delay: 0.1s;
116
         transition-delay: 0.1s;
113
     }
117
     }
114
 }
118
 }
119
+
120
+/**
121
+ * Overrides for self view when in portrait mode on mobile.
122
+ * This is done in order to keep the aspect ratio.
123
+ */
124
+.vertical-filmstrip .self-view-mobile-portrait #localVideo_container {
125
+    object-fit: contain;
126
+}

+ 5
- 6
react/features/filmstrip/components/web/Thumbnail.js View File

34
     DISPLAY_MODE_TO_STRING,
34
     DISPLAY_MODE_TO_STRING,
35
     DISPLAY_VIDEO,
35
     DISPLAY_VIDEO,
36
     DISPLAY_VIDEO_WITH_NAME,
36
     DISPLAY_VIDEO_WITH_NAME,
37
-    MOBILE_FILMSTRIP_PORTRAIT_RATIO,
38
     VIDEO_TEST_EVENTS,
37
     VIDEO_TEST_EVENTS,
39
     SHOW_TOOLBAR_CONTEXT_MENU_AFTER
38
     SHOW_TOOLBAR_CONTEXT_MENU_AFTER
40
 } from '../../constants';
39
 } from '../../constants';
771
         const {
770
         const {
772
             _defaultLocalDisplayName,
771
             _defaultLocalDisplayName,
773
             _disableLocalVideoFlip,
772
             _disableLocalVideoFlip,
774
-            _height,
775
             _isMobile,
773
             _isMobile,
776
             _isMobilePortrait,
774
             _isMobilePortrait,
777
             _isScreenSharing,
775
             _isScreenSharing,
783
         const { id } = _participant || {};
781
         const { id } = _participant || {};
784
         const { audioLevel } = this.state;
782
         const { audioLevel } = this.state;
785
         const styles = this._getStyles();
783
         const styles = this._getStyles();
786
-        const containerClassName = this._getContainerClassName();
784
+        let containerClassName = this._getContainerClassName();
787
         const videoTrackClassName
785
         const videoTrackClassName
788
             = !_disableLocalVideoFlip && _videoTrack && !_isScreenSharing && _localFlipX ? 'flipVideoX' : '';
786
             = !_disableLocalVideoFlip && _videoTrack && !_isScreenSharing && _localFlipX ? 'flipVideoX' : '';
789
 
787
 
790
-        styles.thumbnail.height = _isMobilePortrait
791
-            ? `${Math.floor(_height * MOBILE_FILMSTRIP_PORTRAIT_RATIO)}px`
792
-            : styles.thumbnail.height;
788
+        if (_isMobilePortrait) {
789
+            styles.thumbnail.height = styles.thumbnail.width;
790
+            containerClassName = `${containerClassName} self-view-mobile-portrait`;
791
+        }
793
 
792
 
794
         return (
793
         return (
795
             <span
794
             <span

+ 0
- 8
react/features/filmstrip/constants.js View File

221
  */
221
  */
222
 export const SHOW_TOOLBAR_CONTEXT_MENU_AFTER = 600;
222
 export const SHOW_TOOLBAR_CONTEXT_MENU_AFTER = 600;
223
 
223
 
224
-
225
-/**
226
- * The ratio for filmstrip self view on mobile portrait mode.
227
- *
228
- * @type {number}
229
- */
230
-export const MOBILE_FILMSTRIP_PORTRAIT_RATIO = 2.5;
231
-
232
 /**
224
 /**
233
  * The margin for each side of the tile view. Taken away from the available
225
  * The margin for each side of the tile view. Taken away from the available
234
  * height and width for the tile container to display in.
226
  * height and width for the tile container to display in.

Loading…
Cancel
Save