|
@@ -1,6 +1,5 @@
|
1
|
1
|
/* @flow */
|
2
|
2
|
|
3
|
|
-import _ from 'lodash';
|
4
|
3
|
import React, { Component } from 'react';
|
5
|
4
|
import type { Dispatch } from 'redux';
|
6
|
5
|
|
|
@@ -12,10 +11,9 @@ import {
|
12
|
11
|
import { translate } from '../../../base/i18n';
|
13
|
12
|
import { Icon, IconMenuDown, IconMenuUp } from '../../../base/icons';
|
14
|
13
|
import { connect } from '../../../base/redux';
|
15
|
|
-import { dockToolbox } from '../../../toolbox/actions.web';
|
16
|
14
|
import { isButtonEnabled } from '../../../toolbox/functions.web';
|
17
|
|
-import { getCurrentLayout, LAYOUTS } from '../../../video-layout';
|
18
|
|
-import { setFilmstripHovered, setFilmstripVisible } from '../../actions';
|
|
15
|
+import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
|
|
16
|
+import { setFilmstripVisible } from '../../actions';
|
19
|
17
|
import { shouldRemoteVideosBeVisible } from '../../functions';
|
20
|
18
|
|
21
|
19
|
declare var APP: Object;
|
|
@@ -56,12 +54,6 @@ type Props = {
|
56
|
54
|
*/
|
57
|
55
|
_hideToolbar: boolean,
|
58
|
56
|
|
59
|
|
- /**
|
60
|
|
- * Whether or not remote videos are currently being hovered over. Hover
|
61
|
|
- * handling is currently being handled detected outside of react.
|
62
|
|
- */
|
63
|
|
- _hovered: boolean,
|
64
|
|
-
|
65
|
57
|
/**
|
66
|
58
|
* The number of rows in tile view.
|
67
|
59
|
*/
|
|
@@ -95,13 +87,6 @@ type Props = {
|
95
|
87
|
* @extends Component
|
96
|
88
|
*/
|
97
|
89
|
class Filmstrip extends Component <Props> {
|
98
|
|
- _isHovered: boolean;
|
99
|
|
-
|
100
|
|
- _notifyOfHoveredStateUpdate: Function;
|
101
|
|
-
|
102
|
|
- _onMouseOut: Function;
|
103
|
|
-
|
104
|
|
- _onMouseOver: Function;
|
105
|
90
|
|
106
|
91
|
/**
|
107
|
92
|
* Initializes a new {@code Filmstrip} instance.
|
|
@@ -112,20 +97,7 @@ class Filmstrip extends Component <Props> {
|
112
|
97
|
constructor(props: Props) {
|
113
|
98
|
super(props);
|
114
|
99
|
|
115
|
|
- // Debounce the method for dispatching the new filmstrip handled state
|
116
|
|
- // so that it does not get called with each mouse movement event. This
|
117
|
|
- // also works around an issue where mouseout and then a mouseover event
|
118
|
|
- // is fired when hovering over remote thumbnails, which are not yet in
|
119
|
|
- // react.
|
120
|
|
- this._notifyOfHoveredStateUpdate = _.debounce(this._notifyOfHoveredStateUpdate, 100);
|
121
|
|
-
|
122
|
|
- // Cache the current hovered state for _updateHoveredState to always
|
123
|
|
- // send the last known hovered state.
|
124
|
|
- this._isHovered = false;
|
125
|
|
-
|
126
|
100
|
// Bind event handlers so they are only bound once for every instance.
|
127
|
|
- this._onMouseOut = this._onMouseOut.bind(this);
|
128
|
|
- this._onMouseOver = this._onMouseOver.bind(this);
|
129
|
101
|
this._onShortcutToggleFilmstrip = this._onShortcutToggleFilmstrip.bind(this);
|
130
|
102
|
this._onToolbarToggleFilmstrip = this._onToolbarToggleFilmstrip.bind(this);
|
131
|
103
|
}
|
|
@@ -212,9 +184,7 @@ class Filmstrip extends Component <Props> {
|
212
|
184
|
id = 'remoteVideos'>
|
213
|
185
|
<div
|
214
|
186
|
className = 'filmstrip__videos'
|
215
|
|
- id = 'filmstripLocalVideo'
|
216
|
|
- onMouseOut = { this._onMouseOut }
|
217
|
|
- onMouseOver = { this._onMouseOver }>
|
|
187
|
+ id = 'filmstripLocalVideo'>
|
218
|
188
|
<div id = 'filmstripLocalVideoThumbnail' />
|
219
|
189
|
</div>
|
220
|
190
|
<div
|
|
@@ -228,8 +198,6 @@ class Filmstrip extends Component <Props> {
|
228
|
198
|
<div
|
229
|
199
|
className = { remoteVideoContainerClassName }
|
230
|
200
|
id = 'filmstripRemoteVideosContainer'
|
231
|
|
- onMouseOut = { this._onMouseOut }
|
232
|
|
- onMouseOver = { this._onMouseOver }
|
233
|
201
|
style = { filmstripRemoteVideosContainerStyle }>
|
234
|
202
|
<div id = 'localVideoTileViewContainer' />
|
235
|
203
|
</div>
|
|
@@ -249,44 +217,6 @@ class Filmstrip extends Component <Props> {
|
249
|
217
|
this.props.dispatch(setFilmstripVisible(!this.props._visible));
|
250
|
218
|
}
|
251
|
219
|
|
252
|
|
- /**
|
253
|
|
- * If the current hover state does not match the known hover state in redux,
|
254
|
|
- * dispatch an action to update the known hover state in redux.
|
255
|
|
- *
|
256
|
|
- * @private
|
257
|
|
- * @returns {void}
|
258
|
|
- */
|
259
|
|
- _notifyOfHoveredStateUpdate() {
|
260
|
|
- if (this.props._hovered !== this._isHovered) {
|
261
|
|
- this.props.dispatch(dockToolbox(this._isHovered));
|
262
|
|
- this.props.dispatch(setFilmstripHovered(this._isHovered));
|
263
|
|
- }
|
264
|
|
- }
|
265
|
|
-
|
266
|
|
- /**
|
267
|
|
- * Updates the currently known mouseover state and attempt to dispatch an
|
268
|
|
- * update of the known hover state in redux.
|
269
|
|
- *
|
270
|
|
- * @private
|
271
|
|
- * @returns {void}
|
272
|
|
- */
|
273
|
|
- _onMouseOut() {
|
274
|
|
- this._isHovered = false;
|
275
|
|
- this._notifyOfHoveredStateUpdate();
|
276
|
|
- }
|
277
|
|
-
|
278
|
|
- /**
|
279
|
|
- * Updates the currently known mouseover state and attempt to dispatch an
|
280
|
|
- * update of the known hover state in redux.
|
281
|
|
- *
|
282
|
|
- * @private
|
283
|
|
- * @returns {void}
|
284
|
|
- */
|
285
|
|
- _onMouseOver() {
|
286
|
|
- this._isHovered = true;
|
287
|
|
- this._notifyOfHoveredStateUpdate();
|
288
|
|
- }
|
289
|
|
-
|
290
|
220
|
_onShortcutToggleFilmstrip: () => void;
|
291
|
221
|
|
292
|
222
|
/**
|
|
@@ -358,7 +288,7 @@ class Filmstrip extends Component <Props> {
|
358
|
288
|
*/
|
359
|
289
|
function _mapStateToProps(state) {
|
360
|
290
|
const { iAmSipGateway } = state['features/base/config'];
|
361
|
|
- const { hovered, visible } = state['features/filmstrip'];
|
|
291
|
+ const { visible } = state['features/filmstrip'];
|
362
|
292
|
const reduceHeight
|
363
|
293
|
= state['features/toolbox'].visible && interfaceConfig.TOOLBAR_BUTTONS.length;
|
364
|
294
|
const remoteVideosVisible = shouldRemoteVideosBeVisible(state);
|
|
@@ -376,7 +306,6 @@ function _mapStateToProps(state) {
|
376
|
306
|
_filmstripWidth: filmstripWidth,
|
377
|
307
|
_hideScrollbar: Boolean(iAmSipGateway),
|
378
|
308
|
_hideToolbar: Boolean(iAmSipGateway),
|
379
|
|
- _hovered: hovered,
|
380
|
309
|
_rows: gridDimensions.rows,
|
381
|
310
|
_videosClassName: videosClassName,
|
382
|
311
|
_visible: visible
|