浏览代码

Web Filmstrip & LargeVideo React Components

We've had Filmstrip & LargeVideo React Components on mobile/React Native
from the start. We didn't have them on Web (because the rewrite in React
is not complete yet). However, that led to differences in the React
Component Conference on Web and mobile. In an effort to get closer to
merging the React Component Conference on Web and mobile, introduce the
React Components Filmstrip & LargeVideo on Web even if a minimal
render-only form at this time.
j8
Lyubo Marinov 8 年前
父节点
当前提交
b7c4ebba84

+ 23
- 1
react/features/conference/components/Conference.native.js 查看文件

6
 import { Container } from '../../base/react';
6
 import { Container } from '../../base/react';
7
 import { Filmstrip } from '../../filmstrip';
7
 import { Filmstrip } from '../../filmstrip';
8
 import { LargeVideo } from '../../large-video';
8
 import { LargeVideo } from '../../large-video';
9
+import { OverlayContainer } from '../../overlay';
9
 import { setToolboxVisible, Toolbox } from '../../toolbox';
10
 import { setToolboxVisible, Toolbox } from '../../toolbox';
10
 
11
 
11
 import { styles } from './styles';
12
 import { styles } from './styles';
130
                 style = { styles.conference }
131
                 style = { styles.conference }
131
                 touchFeedback = { false }>
132
                 touchFeedback = { false }>
132
 
133
 
134
+                {/*
135
+                  * The LargeVideo is the lowermost stacking layer.
136
+                  */}
133
                 <LargeVideo />
137
                 <LargeVideo />
134
 
138
 
135
-                <Toolbox />
139
+                {/*
140
+                  * The Filmstrip is in a stacking layer above the LargeVideo.
141
+                  * The LargeVideo and the Filmstrip form what the Web/React app
142
+                  * calls "videospace". Presumably, the name and grouping stem
143
+                  * from the fact that these two React Components depict the
144
+                  * videos of the conference's participants.
145
+                  */}
136
                 <Filmstrip />
146
                 <Filmstrip />
137
 
147
 
148
+                {/*
149
+                  * The Toolbox is in a stacking layer above the Filmstrip.
150
+                  */}
151
+                <Toolbox />
152
+
153
+                {/*
154
+                  * The dialogs and overlays are in the topmost stacking layers.
155
+                  * Generally, the dialogs and overlays should not be visible at
156
+                  * the same time so it is not really defined which one is above
157
+                  * the other.
158
+                  */}
138
                 <DialogContainer />
159
                 <DialogContainer />
160
+                <OverlayContainer />
139
             </Container>
161
             </Container>
140
         );
162
         );
141
     }
163
     }

+ 15
- 102
react/features/conference/components/Conference.web.js 查看文件

5
 
5
 
6
 import { connect, disconnect } from '../../base/connection';
6
 import { connect, disconnect } from '../../base/connection';
7
 import { DialogContainer } from '../../base/dialog';
7
 import { DialogContainer } from '../../base/dialog';
8
-import { Watermarks } from '../../base/react';
8
+import { Filmstrip } from '../../filmstrip';
9
+import { LargeVideo } from '../../large-video';
9
 import { OverlayContainer } from '../../overlay';
10
 import { OverlayContainer } from '../../overlay';
10
 import { Toolbox } from '../../toolbox';
11
 import { Toolbox } from '../../toolbox';
11
 import { HideNotificationBarStyle } from '../../unsupported-browser';
12
 import { HideNotificationBarStyle } from '../../unsupported-browser';
12
-import { VideoStatusLabel } from '../../video-status-label';
13
-import '../../filmstrip';
14
 
13
 
15
 declare var $: Function;
14
 declare var $: Function;
16
 declare var APP: Object;
15
 declare var APP: Object;
68
     render() {
67
     render() {
69
         return (
68
         return (
70
             <div id = 'videoconference_page'>
69
             <div id = 'videoconference_page'>
71
-                <Toolbox />
72
-
73
                 <div id = 'videospace'>
70
                 <div id = 'videospace'>
74
-                    <div
75
-                        className = 'videocontainer'
76
-                        id = 'largeVideoContainer'>
77
-                        <div id = 'sharedVideo'>
78
-                            <div id = 'sharedVideoIFrame' />
79
-                        </div>
80
-                        <div id = 'etherpad' />
81
-
82
-                        <Watermarks />
83
-
84
-                        <div id = 'dominantSpeaker'>
85
-                            <div className = 'dynamic-shadow' />
86
-                            <img
87
-                                id = 'dominantSpeakerAvatar'
88
-                                src = '' />
89
-                        </div>
90
-                        <span id = 'remoteConnectionMessage' />
91
-                        <div id = 'largeVideoWrapper'>
92
-                            <video
93
-                                autoPlay = { true }
94
-                                id = 'largeVideo'
95
-                                muted = 'true' />
96
-                        </div>
97
-                        <span id = 'localConnectionMessage' />
98
-                        <VideoStatusLabel />
99
-                        <span
100
-                            className
101
-                                = 'video-state-indicator centeredVideoLabel'
102
-                            id = 'recordingLabel'>
103
-                            <span id = 'recordingLabelText' />
104
-                            <img
105
-                                className = 'recordingSpinner'
106
-                                id = 'recordingSpinner'
107
-                                src = 'images/spin.svg' />
108
-                        </span>
109
-                    </div>
110
-                    { this._renderFilmstrip() }
71
+                    <LargeVideo />
72
+
73
+                    <Filmstrip />
111
                 </div>
74
                 </div>
112
 
75
 
76
+                <Toolbox />
77
+
113
                 <DialogContainer />
78
                 <DialogContainer />
114
                 <OverlayContainer />
79
                 <OverlayContainer />
115
-                <HideNotificationBarStyle />
116
-            </div>
117
-        );
118
-    }
119
 
80
 
120
-    /**
121
-     * Creates a React Element for displaying filmstrip videos.
122
-     *
123
-     * @private
124
-     * @returns {ReactElement}
125
-     */
126
-    _renderFilmstrip() {
127
-        return (
128
-            <div className = 'filmstrip'>
129
-                <div
130
-                    className = 'filmstrip__videos'
131
-                    id = 'remoteVideos'>
132
-                    <div
133
-                        className = 'filmstrip__videos'
134
-                        id = 'filmstripLocalVideo'>
135
-                        <span
136
-                            className = 'videocontainer'
137
-                            id = 'localVideoContainer'>
138
-                            <div className = 'videocontainer__background' />
139
-                            <span id = 'localVideoWrapper' />
140
-                            <audio
141
-                                autoPlay = { true }
142
-                                id = 'localAudio'
143
-                                muted = { true } />
144
-                            <div className = 'videocontainer__toolbar' />
145
-                            <div className = 'videocontainer__toptoolbar' />
146
-                            <div
147
-                                className
148
-                                    = 'videocontainer__hoverOverlay' />
149
-                        </span>
150
-                    </div>
151
-                    <div
152
-                        className = 'filmstrip__videos'
153
-                        id = 'filmstripRemoteVideos'>
154
-                        {
155
-
156
-                            /*
157
-                                This extra video container is needed for
158
-                                scrolling thumbnails in firefox, otherwise the
159
-                                flex thumbnails resize instead of causing
160
-                                overflow.
161
-                            */
162
-                        }
163
-                        <div
164
-                            className = 'remote-videos-container'
165
-                            id = 'filmstripRemoteVideosContainer' />
166
-                    </div>
167
-                    <audio
168
-                        id = 'userJoined'
169
-                        preload = 'auto'
170
-                        src = 'sounds/joined.wav' />
171
-                    <audio
172
-                        id = 'userLeft'
173
-                        preload = 'auto'
174
-                        src = 'sounds/left.wav' />
175
-                </div>
81
+                {/*
82
+                  * Temasys automatically injects a notification bar, if
83
+                  * necessary, displayed at the top of the page notifying that
84
+                  * WebRTC is not installed or supported. We do not need/want
85
+                  * the notification bar in question because we have whole pages
86
+                  * dedicated to the respective scenarios.
87
+                  */}
88
+                <HideNotificationBarStyle />
176
             </div>
89
             </div>
177
         );
90
         );
178
     }
91
     }

+ 5
- 1
react/features/filmstrip/components/Filmstrip.native.js 查看文件

1
+/* @flow */
2
+
1
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
2
 import { ScrollView } from 'react-native';
4
 import { ScrollView } from 'react-native';
3
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
8
 import { styles } from './_';
10
 import { styles } from './_';
9
 
11
 
10
 /**
12
 /**
11
- * React component for filmstrip.
13
+ * Implements a React {@link Component} which represents the filmstrip on
14
+ * mobile/React Native.
12
  *
15
  *
13
  * @extends Component
16
  * @extends Component
14
  */
17
  */
40
      * Implements React's {@link Component#render()}.
43
      * Implements React's {@link Component#render()}.
41
      *
44
      *
42
      * @inheritdoc
45
      * @inheritdoc
46
+     * @returns {ReactElement}
43
      */
47
      */
44
     render() {
48
     render() {
45
         return (
49
         return (

+ 65
- 0
react/features/filmstrip/components/Filmstrip.web.js 查看文件

1
+/* @flow */
2
+
3
+import React, { Component } from 'react';
4
+
5
+/**
6
+ * Implements a React {@link Component} which represents the filmstrip on
7
+ * Web/React.
8
+ *
9
+ * @extends Component
10
+ */
11
+export default class Filmstrip extends Component {
12
+    /**
13
+     * Implements React's {@link Component#render()}.
14
+     *
15
+     * @inheritdoc
16
+     * @returns {ReactElement}
17
+     */
18
+    render() {
19
+        return (
20
+            <div className = 'filmstrip'>
21
+                <div
22
+                    className = 'filmstrip__videos'
23
+                    id = 'remoteVideos'>
24
+                    <div
25
+                        className = 'filmstrip__videos'
26
+                        id = 'filmstripLocalVideo'>
27
+                        <span
28
+                            className = 'videocontainer'
29
+                            id = 'localVideoContainer'>
30
+                            <div className = 'videocontainer__background' />
31
+                            <span id = 'localVideoWrapper' />
32
+                            <audio
33
+                                autoPlay = { true }
34
+                                id = 'localAudio'
35
+                                muted = { true } />
36
+                            <div className = 'videocontainer__toolbar' />
37
+                            <div className = 'videocontainer__toptoolbar' />
38
+                            <div className = 'videocontainer__hoverOverlay' />
39
+                        </span>
40
+                    </div>
41
+                    <div
42
+                        className = 'filmstrip__videos'
43
+                        id = 'filmstripRemoteVideos'>
44
+                        {/*
45
+                          * This extra video container is needed for scrolling
46
+                          * thumbnails in Firefox; otherwise, the flex
47
+                          * thumbnails resize instead of causing overflow.
48
+                          */}
49
+                        <div
50
+                            className = 'remote-videos-container'
51
+                            id = 'filmstripRemoteVideosContainer' />
52
+                    </div>
53
+                    <audio
54
+                        id = 'userJoined'
55
+                        preload = 'auto'
56
+                        src = 'sounds/joined.wav' />
57
+                    <audio
58
+                        id = 'userLeft'
59
+                        preload = 'auto'
60
+                        src = 'sounds/left.wav' />
61
+                </div>
62
+            </div>
63
+        );
64
+    }
65
+}

+ 0
- 0
react/features/filmstrip/components/_.web.js 查看文件


react/features/large-video/components/LargeVideo.js → react/features/large-video/components/LargeVideo.native.js 查看文件

1
+/* @flow */
2
+
1
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
2
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
3
 
5
 
6
 import { styles } from './styles';
8
 import { styles } from './styles';
7
 
9
 
8
 /**
10
 /**
9
- * Large video React component.
11
+ * Implements a React {@link Component} which represents the large video (a.k.a.
12
+ * the conference participant who is on the local stage) on mobile/React Native.
10
  *
13
  *
11
  * @extends Component
14
  * @extends Component
12
  */
15
  */

+ 62
- 0
react/features/large-video/components/LargeVideo.web.js 查看文件

1
+/* @flow */
2
+
3
+import React, { Component } from 'react';
4
+
5
+import { Watermarks } from '../../base/react';
6
+import { VideoStatusLabel } from '../../video-status-label';
7
+
8
+/**
9
+ * Implements a React {@link Component} which represents the large video (a.k.a.
10
+ * the conference participant who is on the local stage) on Web/React.
11
+ *
12
+ * @extends Component
13
+ */
14
+export default class LargeVideo extends Component {
15
+    /**
16
+     * Implements React's {@link Component#render()}.
17
+     *
18
+     * @inheritdoc
19
+     * @returns {ReactElement}
20
+     */
21
+    render() {
22
+        return (
23
+            <div
24
+                className = 'videocontainer'
25
+                id = 'largeVideoContainer'>
26
+                <div id = 'sharedVideo'>
27
+                    <div id = 'sharedVideoIFrame' />
28
+                </div>
29
+                <div id = 'etherpad' />
30
+
31
+                <Watermarks />
32
+
33
+                <div id = 'dominantSpeaker'>
34
+                    <div className = 'dynamic-shadow' />
35
+                    <img
36
+                        id = 'dominantSpeakerAvatar'
37
+                        src = '' />
38
+                </div>
39
+                <span id = 'remoteConnectionMessage' />
40
+                <div id = 'largeVideoWrapper'>
41
+                    <video
42
+                        autoPlay = { true }
43
+                        id = 'largeVideo'
44
+                        muted = { true } />
45
+                </div>
46
+                <span id = 'localConnectionMessage' />
47
+
48
+                <VideoStatusLabel />
49
+
50
+                <span
51
+                    className = 'video-state-indicator centeredVideoLabel'
52
+                    id = 'recordingLabel'>
53
+                    <span id = 'recordingLabelText' />
54
+                    <img
55
+                        className = 'recordingSpinner'
56
+                        id = 'recordingSpinner'
57
+                        src = 'images/spin.svg' />
58
+                </span>
59
+            </div>
60
+        );
61
+    }
62
+}

正在加载...
取消
保存