瀏覽代碼

[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.
master
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,7 +4,7 @@ import React, { Component } from 'react';
4 4
 import { ScrollView } from 'react-native';
5 5
 import { connect } from 'react-redux';
6 6
 
7
-import { Container } from '../../../base/react';
7
+import { Container, Platform } from '../../../base/react';
8 8
 import {
9 9
     isNarrowAspectRatio,
10 10
     makeAspectRatioAware
@@ -48,6 +48,40 @@ type Props = {
48 48
  * @extends Component
49 49
  */
50 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 86
      * Implements React's {@link Component#render()}.
53 87
      *
@@ -70,13 +104,20 @@ class Filmstrip extends Component<Props> {
70 104
                 style = { filmstripStyle }
71 105
                 visible = { this.props._visible }>
72 106
                 {
73
-                    !isNarrowAspectRatio_ && <LocalThumbnail />
107
+                    this._separateLocalThumbnail
108
+                        && !isNarrowAspectRatio_
109
+                        && <LocalThumbnail />
74 110
                 }
75 111
                 <ScrollView
76 112
                     horizontal = { isNarrowAspectRatio_ }
77 113
                     showsHorizontalScrollIndicator = { false }
78 114
                     showsVerticalScrollIndicator = { false }
79 115
                     style = { styles.scrollView } >
116
+                    {
117
+                        !this._separateLocalThumbnail
118
+                            && !isNarrowAspectRatio_
119
+                            && <LocalThumbnail />
120
+                    }
80 121
                     {
81 122
                         /* eslint-disable react/jsx-wrap-multilines */
82 123
 
@@ -90,9 +131,16 @@ class Filmstrip extends Component<Props> {
90 131
 
91 132
                         /* eslint-enable react/jsx-wrap-multilines */
92 133
                     }
134
+                    {
135
+                        !this._separateLocalThumbnail
136
+                            && isNarrowAspectRatio_
137
+                            && <LocalThumbnail />
138
+                    }
93 139
                 </ScrollView>
94 140
                 {
95
-                    isNarrowAspectRatio_ && <LocalThumbnail />
141
+                    this._separateLocalThumbnail
142
+                        && isNarrowAspectRatio_
143
+                        && <LocalThumbnail />
96 144
                 }
97 145
             </Container>
98 146
         );

Loading…
取消
儲存