|
|
@@ -1,6 +1,7 @@
|
|
1
|
1
|
/* @flow */
|
|
2
|
2
|
|
|
3
|
3
|
import React, { Component } from 'react';
|
|
|
4
|
+import { connect } from 'react-redux';
|
|
4
|
5
|
|
|
5
|
6
|
import { Toolbox } from '../../toolbox';
|
|
6
|
7
|
|
|
|
@@ -10,8 +11,14 @@ import { Toolbox } from '../../toolbox';
|
|
10
|
11
|
*
|
|
11
|
12
|
* @extends Component
|
|
12
|
13
|
*/
|
|
13
|
|
-export default class Filmstrip extends Component {
|
|
|
14
|
+class Filmstrip extends Component {
|
|
14
|
15
|
static propTypes = {
|
|
|
16
|
+ /**
|
|
|
17
|
+ * Whether or not the remote videos should be visible. Will toggle
|
|
|
18
|
+ * a class for hiding the videos.
|
|
|
19
|
+ */
|
|
|
20
|
+ _remoteVideosVisible: React.PropTypes.bool,
|
|
|
21
|
+
|
|
15
|
22
|
/**
|
|
16
|
23
|
* Whether or not the toolbox should be displayed within the filmstrip.
|
|
17
|
24
|
*/
|
|
|
@@ -25,8 +32,20 @@ export default class Filmstrip extends Component {
|
|
25
|
32
|
* @returns {ReactElement}
|
|
26
|
33
|
*/
|
|
27
|
34
|
render() {
|
|
|
35
|
+ /**
|
|
|
36
|
+ * Note: Appending of {@code RemoteVideo} views is handled through
|
|
|
37
|
+ * VideoLayout. The views do not get blown away on render() because
|
|
|
38
|
+ * ReactDOMComponent is only aware of the given JSX and not new appended
|
|
|
39
|
+ * DOM. As such, when updateDOMProperties gets called, only attributes
|
|
|
40
|
+ * will get updated without replacing the DOM. If the known DOM gets
|
|
|
41
|
+ * modified, then the views will get blown away.
|
|
|
42
|
+ */
|
|
|
43
|
+
|
|
|
44
|
+ const filmstripClassNames = `filmstrip ${this.props._remoteVideosVisible
|
|
|
45
|
+ ? '' : 'hide-videos'}`;
|
|
|
46
|
+
|
|
28
|
47
|
return (
|
|
29
|
|
- <div className = 'filmstrip'>
|
|
|
48
|
+ <div className = { filmstripClassNames }>
|
|
30
|
49
|
{ this.props.displayToolbox ? <Toolbox /> : null }
|
|
31
|
50
|
<div
|
|
32
|
51
|
className = 'filmstrip__videos'
|
|
|
@@ -53,7 +72,7 @@ export default class Filmstrip extends Component {
|
|
53
|
72
|
<div
|
|
54
|
73
|
className = 'filmstrip__videos'
|
|
55
|
74
|
id = 'filmstripRemoteVideos'>
|
|
56
|
|
- {/*
|
|
|
75
|
+ {/**
|
|
57
|
76
|
* This extra video container is needed for scrolling
|
|
58
|
77
|
* thumbnails in Firefox; otherwise, the flex
|
|
59
|
78
|
* thumbnails resize instead of causing overflow.
|
|
|
@@ -75,3 +94,23 @@ export default class Filmstrip extends Component {
|
|
75
|
94
|
);
|
|
76
|
95
|
}
|
|
77
|
96
|
}
|
|
|
97
|
+
|
|
|
98
|
+/**
|
|
|
99
|
+ * Maps (parts of) the Redux state to the associated {@code Filmstrip}'s props.
|
|
|
100
|
+ *
|
|
|
101
|
+ * @param {Object} state - The Redux state.
|
|
|
102
|
+ * @private
|
|
|
103
|
+ * @returns {{
|
|
|
104
|
+ * _remoteVideosVisible: boolean
|
|
|
105
|
+ * }}
|
|
|
106
|
+ */
|
|
|
107
|
+function _mapStateToProps(state) {
|
|
|
108
|
+ const { remoteVideosVisible } = state['features/filmstrip'];
|
|
|
109
|
+ const { disable1On1Mode } = state['features/base/config'];
|
|
|
110
|
+
|
|
|
111
|
+ return {
|
|
|
112
|
+ _remoteVideosVisible: Boolean(remoteVideosVisible || disable1On1Mode)
|
|
|
113
|
+ };
|
|
|
114
|
+}
|
|
|
115
|
+
|
|
|
116
|
+export default connect(_mapStateToProps)(Filmstrip);
|