|
@@ -1,5 +1,7 @@
|
1
|
1
|
/* @flow */
|
2
|
2
|
|
|
3
|
+import { withStyles } from '@material-ui/styles';
|
|
4
|
+import clsx from 'clsx';
|
3
|
5
|
import React, { PureComponent } from 'react';
|
4
|
6
|
import { FixedSizeList, FixedSizeGrid } from 'react-window';
|
5
|
7
|
import type { Dispatch } from 'redux';
|
|
@@ -80,6 +82,11 @@ type Props = {
|
80
|
82
|
*/
|
81
|
83
|
_isFilmstripButtonEnabled: boolean,
|
82
|
84
|
|
|
85
|
+ /**
|
|
86
|
+ * Whether or not the current layout is vertical filmstrip.
|
|
87
|
+ */
|
|
88
|
+ _isVerticalFilmstrip: boolean,
|
|
89
|
+
|
83
|
90
|
/**
|
84
|
91
|
* The participants in the call.
|
85
|
92
|
*/
|
|
@@ -125,6 +132,11 @@ type Props = {
|
125
|
132
|
*/
|
126
|
133
|
_isToolboxVisible: Boolean,
|
127
|
134
|
|
|
135
|
+ /**
|
|
136
|
+ * An object containing the CSS classes.
|
|
137
|
+ */
|
|
138
|
+ classes: Object,
|
|
139
|
+
|
128
|
140
|
/**
|
129
|
141
|
* The redux {@code dispatch} function.
|
130
|
142
|
*/
|
|
@@ -136,6 +148,84 @@ type Props = {
|
136
|
148
|
t: Function
|
137
|
149
|
};
|
138
|
150
|
|
|
151
|
+/**
|
|
152
|
+ * Creates the styles for the component.
|
|
153
|
+ *
|
|
154
|
+ * @param {Object} theme - The current theme.
|
|
155
|
+ * @returns {Object}
|
|
156
|
+ */
|
|
157
|
+const styles = theme => {
|
|
158
|
+ return {
|
|
159
|
+ toggleFilmstripContainer: {
|
|
160
|
+ display: 'flex',
|
|
161
|
+ flexWrap: 'nowrap',
|
|
162
|
+ alignItems: 'center',
|
|
163
|
+ justifyContent: 'center',
|
|
164
|
+ backgroundColor: 'rgba(0, 0, 0, .6)',
|
|
165
|
+ width: '32px',
|
|
166
|
+ height: '24px',
|
|
167
|
+ position: 'absolute',
|
|
168
|
+ borderRadius: '4px',
|
|
169
|
+ top: 'calc(-24px - 2px)',
|
|
170
|
+ left: 'calc(50% - 16px)',
|
|
171
|
+ opacity: 0,
|
|
172
|
+ transition: 'opacity .3s'
|
|
173
|
+ },
|
|
174
|
+
|
|
175
|
+ toggleFilmstripButton: {
|
|
176
|
+ fontSize: '14px',
|
|
177
|
+ lineHeight: 1.2,
|
|
178
|
+ textAlign: 'center',
|
|
179
|
+ background: 'transparent',
|
|
180
|
+ height: 'auto',
|
|
181
|
+ width: '100%',
|
|
182
|
+ padding: 0,
|
|
183
|
+ margin: 0,
|
|
184
|
+ border: 'none',
|
|
185
|
+
|
|
186
|
+ '-webkit-appearance': 'none',
|
|
187
|
+
|
|
188
|
+ '& svg': {
|
|
189
|
+ fill: theme.palette.icon02
|
|
190
|
+ }
|
|
191
|
+ },
|
|
192
|
+
|
|
193
|
+ toggleVerticalFilmstripContainer: {
|
|
194
|
+ transform: 'rotate(-90deg)',
|
|
195
|
+ left: 'calc(-24px - 2px - 5px)',
|
|
196
|
+ top: 'calc(50% - 16px)'
|
|
197
|
+ },
|
|
198
|
+
|
|
199
|
+ filmstrip: {
|
|
200
|
+ transition: 'background .2s ease-in-out, right 1s, bottom 1s, height .3s ease-in',
|
|
201
|
+ right: 0,
|
|
202
|
+ bottom: 0,
|
|
203
|
+
|
|
204
|
+ '&:hover': {
|
|
205
|
+ backgroundColor: 'rgba(0, 0, 0, .6)',
|
|
206
|
+
|
|
207
|
+ '& .toggleFilmstripContainer': {
|
|
208
|
+ opacity: 1
|
|
209
|
+ }
|
|
210
|
+ },
|
|
211
|
+
|
|
212
|
+ '.horizontal-filmstrip &.hidden': {
|
|
213
|
+ bottom: '-50px',
|
|
214
|
+
|
|
215
|
+ '&:hover': {
|
|
216
|
+ backgroundColor: 'transparent'
|
|
217
|
+ }
|
|
218
|
+ },
|
|
219
|
+
|
|
220
|
+ '&.hidden': {
|
|
221
|
+ '& .toggleFilmstripContainer': {
|
|
222
|
+ opacity: 1
|
|
223
|
+ }
|
|
224
|
+ }
|
|
225
|
+ }
|
|
226
|
+ };
|
|
227
|
+};
|
|
228
|
+
|
139
|
229
|
/**
|
140
|
230
|
* Implements a React {@link Component} which represents the filmstrip on
|
141
|
231
|
* Web/React.
|
|
@@ -195,7 +285,7 @@ class Filmstrip extends PureComponent <Props> {
|
195
|
285
|
*/
|
196
|
286
|
render() {
|
197
|
287
|
const filmstripStyle = { };
|
198
|
|
- const { _currentLayout, _disableSelfView } = this.props;
|
|
288
|
+ const { _currentLayout, _disableSelfView, classes, _visible } = this.props;
|
199
|
289
|
const tileViewActive = _currentLayout === LAYOUTS.TILE_VIEW;
|
200
|
290
|
|
201
|
291
|
switch (_currentLayout) {
|
|
@@ -203,18 +293,24 @@ class Filmstrip extends PureComponent <Props> {
|
203
|
293
|
// Adding 18px for the 2px margins, 2px borders on the left and right and 5px padding on the left and right.
|
204
|
294
|
// Also adding 7px for the scrollbar.
|
205
|
295
|
filmstripStyle.maxWidth = (interfaceConfig.FILM_STRIP_MAX_HEIGHT || 120) + 25;
|
|
296
|
+
|
|
297
|
+ if (!_visible) {
|
|
298
|
+ filmstripStyle.right = `-${filmstripStyle.maxWidth + 2}px`;
|
|
299
|
+ }
|
206
|
300
|
break;
|
207
|
301
|
}
|
208
|
302
|
|
209
|
303
|
let toolbar = null;
|
210
|
304
|
|
211
|
|
- if (!this.props._iAmRecorder && this.props._isFilmstripButtonEnabled) {
|
|
305
|
+ if (!this.props._iAmRecorder && this.props._isFilmstripButtonEnabled && _currentLayout !== LAYOUTS.TILE_VIEW) {
|
212
|
306
|
toolbar = this._renderToggleButton();
|
213
|
307
|
}
|
214
|
308
|
|
215
|
309
|
return (
|
216
|
310
|
<div
|
217
|
|
- className = { `filmstrip ${this.props._className}` }
|
|
311
|
+ className = { clsx('filmstrip',
|
|
312
|
+ this.props._className,
|
|
313
|
+ classes.filmstrip) }
|
218
|
314
|
style = { filmstripStyle }>
|
219
|
315
|
{ toolbar }
|
220
|
316
|
<div
|
|
@@ -534,17 +630,20 @@ class Filmstrip extends PureComponent <Props> {
|
534
|
630
|
*/
|
535
|
631
|
_renderToggleButton() {
|
536
|
632
|
const icon = this.props._visible ? IconMenuDown : IconMenuUp;
|
537
|
|
- const { t } = this.props;
|
|
633
|
+ const { t, classes, _isVerticalFilmstrip } = this.props;
|
538
|
634
|
const actions = isMobileBrowser()
|
539
|
635
|
? { onTouchStart: this._onToggleButtonTouch }
|
540
|
636
|
: { onClick: this._onToolbarToggleFilmstrip };
|
541
|
637
|
|
542
|
638
|
return (
|
543
|
639
|
<div
|
544
|
|
- className = 'filmstrip__toolbar'>
|
|
640
|
+ className = { clsx(classes.toggleFilmstripContainer,
|
|
641
|
+ _isVerticalFilmstrip && classes.toggleVerticalFilmstripContainer,
|
|
642
|
+ 'toggleFilmstripContainer') }>
|
545
|
643
|
<button
|
546
|
644
|
aria-expanded = { this.props._visible }
|
547
|
645
|
aria-label = { t('toolbar.accessibilityLabel.toggleFilmstrip') }
|
|
646
|
+ className = { classes.toggleFilmstripButton }
|
548
|
647
|
id = 'toggleFilmstripButton'
|
549
|
648
|
onFocus = { this._onTabIn }
|
550
|
649
|
tabIndex = { 0 }
|
|
@@ -600,10 +699,13 @@ function _mapStateToProps(state) {
|
600
|
699
|
&& isMobileBrowser()
|
601
|
700
|
&& clientWidth <= ASPECT_RATIO_BREAKPOINT;
|
602
|
701
|
|
603
|
|
- const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
|
604
|
|
- reduceHeight ? 'reduce-height' : ''
|
605
|
|
- } ${shiftRight ? 'shift-right' : ''} ${collapseTileView ? 'collapse' : ''}`.trim();
|
|
702
|
+ const shouldReduceHeight = reduceHeight && (
|
|
703
|
+ isMobileBrowser() || _currentLayout !== LAYOUTS.VERTICAL_FILMSTRIP_VIEW);
|
|
704
|
+
|
606
|
705
|
const videosClassName = `filmstrip__videos${visible ? '' : ' hidden'}`;
|
|
706
|
+ const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
|
|
707
|
+ shouldReduceHeight ? 'reduce-height' : ''
|
|
708
|
+ } ${shiftRight ? 'shift-right' : ''} ${collapseTileView ? 'collapse' : ''} ${visible ? '' : 'hidden'}`.trim();
|
607
|
709
|
let _thumbnailSize, remoteFilmstripHeight, remoteFilmstripWidth;
|
608
|
710
|
|
609
|
711
|
switch (_currentLayout) {
|
|
@@ -616,7 +718,7 @@ function _mapStateToProps(state) {
|
616
|
718
|
const { remote, remoteVideosContainer } = state['features/filmstrip'].verticalViewDimensions;
|
617
|
719
|
|
618
|
720
|
_thumbnailSize = remote;
|
619
|
|
- remoteFilmstripHeight = remoteVideosContainer?.height - (reduceHeight ? TOOLBAR_HEIGHT : 0);
|
|
721
|
+ remoteFilmstripHeight = remoteVideosContainer?.height - (shouldReduceHeight ? TOOLBAR_HEIGHT : 0);
|
620
|
722
|
remoteFilmstripWidth = remoteVideosContainer?.width;
|
621
|
723
|
break;
|
622
|
724
|
}
|
|
@@ -647,8 +749,9 @@ function _mapStateToProps(state) {
|
647
|
749
|
_thumbnailsReordered: enableThumbnailReordering,
|
648
|
750
|
_videosClassName: videosClassName,
|
649
|
751
|
_visible: visible,
|
650
|
|
- _isToolboxVisible: isToolboxVisible(state)
|
|
752
|
+ _isToolboxVisible: isToolboxVisible(state),
|
|
753
|
+ _isVerticalFilmstrip: _currentLayout === LAYOUTS.VERTICAL_FILMSTRIP_VIEW
|
651
|
754
|
};
|
652
|
755
|
}
|
653
|
756
|
|
654
|
|
-export default translate(connect(_mapStateToProps)(Filmstrip));
|
|
757
|
+export default withStyles(styles)(translate(connect(_mapStateToProps)(Filmstrip)));
|