浏览代码

[RN] Disable filmstrip separation on Android

This zOrder change fixes the issue that the scrollable filmstrip videos
rendered in front of the local participant, however there is still an
issue that needs to be fixed later: The rendered videos should have
overflow: 'hidden' property applied so then they don't get rendered when
scrolled out of the ScrollView, that property however doesn't seem to
work for Video components.
j8
Bettenbuk Zoltan 7 年前
父节点
当前提交
c95cb0e9cf
共有 1 个文件被更改,包括 51 次插入3 次删除
  1. 51
    3
      react/features/filmstrip/components/native/Filmstrip.js

+ 51
- 3
react/features/filmstrip/components/native/Filmstrip.js 查看文件

4
 import { ScrollView } from 'react-native';
4
 import { ScrollView } from 'react-native';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
-import { Container } from '../../../base/react';
7
+import { Container, Platform } from '../../../base/react';
8
 import {
8
 import {
9
     isNarrowAspectRatio,
9
     isNarrowAspectRatio,
10
     makeAspectRatioAware
10
     makeAspectRatioAware
48
  * @extends Component
48
  * @extends Component
49
  */
49
  */
50
 class Filmstrip extends Component<Props> {
50
 class Filmstrip extends Component<Props> {
51
+    /**
52
+     * Whether the local participant should be rendered separately from the
53
+     * remote participants i.e. outside of their {@link ScrollView}.
54
+     */
55
+    _separateLocalThumbnail: boolean;
56
+
57
+    /**
58
+     * Constructor of the component.
59
+     *
60
+     * @inheritdoc
61
+     */
62
+    constructor(props) {
63
+        super(props);
64
+
65
+        // XXX Our current design is to have the local participant separate from
66
+        // the remote participants. Unfortunately, Android's Video
67
+        // implementation cannot accommodate that because remote participants'
68
+        // videos appear on top of the local participant's video at times.
69
+        // That's because Android's Video utilizes EGL and EGL gives us only two
70
+        // practical layers in which we can place our participants' videos:
71
+        // layer #0 sits behind the window, creates a hole in the window, and
72
+        // there we render the LargeVideo; layer #1 is known as media overlay in
73
+        // EGL terms, renders on top of layer #0, and, consequently, is for the
74
+        // Filmstrip. With the separate LocalThumnail, we should have left the
75
+        // remote participants' Thumbnails in layer #1 and utilized layer #2 for
76
+        // LocalThumbnail. Unfortunately, layer #2 is not practical (that's why
77
+        // I said we had two practical layers only) because it renders on top of
78
+        // everything which in our case means on top of participant-related
79
+        // indicators such as moderator, audio and video muted, etc. For now we
80
+        // do not have much of a choice but to continue rendering LocalThumbnail
81
+        // as any other remote Thumbnail on Android.
82
+        this._separateLocalThumbnail = Platform.OS !== 'android';
83
+    }
84
+
51
     /**
85
     /**
52
      * Implements React's {@link Component#render()}.
86
      * Implements React's {@link Component#render()}.
53
      *
87
      *
70
                 style = { filmstripStyle }
104
                 style = { filmstripStyle }
71
                 visible = { this.props._visible }>
105
                 visible = { this.props._visible }>
72
                 {
106
                 {
73
-                    !isNarrowAspectRatio_ && <LocalThumbnail />
107
+                    this._separateLocalThumbnail
108
+                        && !isNarrowAspectRatio_
109
+                        && <LocalThumbnail />
74
                 }
110
                 }
75
                 <ScrollView
111
                 <ScrollView
76
                     horizontal = { isNarrowAspectRatio_ }
112
                     horizontal = { isNarrowAspectRatio_ }
77
                     showsHorizontalScrollIndicator = { false }
113
                     showsHorizontalScrollIndicator = { false }
78
                     showsVerticalScrollIndicator = { false }
114
                     showsVerticalScrollIndicator = { false }
79
                     style = { styles.scrollView } >
115
                     style = { styles.scrollView } >
116
+                    {
117
+                        !this._separateLocalThumbnail
118
+                            && !isNarrowAspectRatio_
119
+                            && <LocalThumbnail />
120
+                    }
80
                     {
121
                     {
81
                         /* eslint-disable react/jsx-wrap-multilines */
122
                         /* eslint-disable react/jsx-wrap-multilines */
82
 
123
 
90
 
131
 
91
                         /* eslint-enable react/jsx-wrap-multilines */
132
                         /* eslint-enable react/jsx-wrap-multilines */
92
                     }
133
                     }
134
+                    {
135
+                        !this._separateLocalThumbnail
136
+                            && isNarrowAspectRatio_
137
+                            && <LocalThumbnail />
138
+                    }
93
                 </ScrollView>
139
                 </ScrollView>
94
                 {
140
                 {
95
-                    isNarrowAspectRatio_ && <LocalThumbnail />
141
+                    this._separateLocalThumbnail
142
+                        && isNarrowAspectRatio_
143
+                        && <LocalThumbnail />
96
                 }
144
                 }
97
             </Container>
145
             </Container>
98
         );
146
         );

正在加载...
取消
保存