浏览代码

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

master
Vlad Piersec 4 年前
父节点
当前提交
0a9b9bb41d

+ 12
- 0
css/filmstrip/_vertical_filmstrip_overrides.scss 查看文件

@@ -84,6 +84,10 @@
84 84
         margin-bottom: 3px;
85 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,3 +116,11 @@
112 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 查看文件

@@ -34,7 +34,6 @@ import {
34 34
     DISPLAY_MODE_TO_STRING,
35 35
     DISPLAY_VIDEO,
36 36
     DISPLAY_VIDEO_WITH_NAME,
37
-    MOBILE_FILMSTRIP_PORTRAIT_RATIO,
38 37
     VIDEO_TEST_EVENTS,
39 38
     SHOW_TOOLBAR_CONTEXT_MENU_AFTER
40 39
 } from '../../constants';
@@ -771,7 +770,6 @@ class Thumbnail extends Component<Props, State> {
771 770
         const {
772 771
             _defaultLocalDisplayName,
773 772
             _disableLocalVideoFlip,
774
-            _height,
775 773
             _isMobile,
776 774
             _isMobilePortrait,
777 775
             _isScreenSharing,
@@ -783,13 +781,14 @@ class Thumbnail extends Component<Props, State> {
783 781
         const { id } = _participant || {};
784 782
         const { audioLevel } = this.state;
785 783
         const styles = this._getStyles();
786
-        const containerClassName = this._getContainerClassName();
784
+        let containerClassName = this._getContainerClassName();
787 785
         const videoTrackClassName
788 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 793
         return (
795 794
             <span

+ 0
- 8
react/features/filmstrip/constants.js 查看文件

@@ -221,14 +221,6 @@ export const HORIZONTAL_FILMSTRIP_MARGIN = 39;
221 221
  */
222 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 225
  * The margin for each side of the tile view. Taken away from the available
234 226
  * height and width for the tile container to display in.

正在加载...
取消
保存