2017-05-24 17:01:46 +00:00
|
|
|
/* @flow */
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
2017-08-12 00:27:30 +00:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-24 17:01:46 +00:00
|
|
|
|
2017-07-06 02:07:00 +00:00
|
|
|
import { Toolbox } from '../../toolbox';
|
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
/**
|
|
|
|
* Implements a React {@link Component} which represents the filmstrip on
|
|
|
|
* Web/React.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
2017-08-12 00:27:30 +00:00
|
|
|
class Filmstrip extends Component {
|
2017-07-06 02:07:00 +00:00
|
|
|
static propTypes = {
|
2017-08-12 00:27:30 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the remote videos should be visible. Will toggle
|
|
|
|
* a class for hiding the videos.
|
|
|
|
*/
|
|
|
|
_remoteVideosVisible: React.PropTypes.bool,
|
|
|
|
|
2017-07-06 02:07:00 +00:00
|
|
|
/**
|
|
|
|
* Whether or not the toolbox should be displayed within the filmstrip.
|
|
|
|
*/
|
|
|
|
displayToolbox: React.PropTypes.bool
|
|
|
|
};
|
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2017-08-12 00:27:30 +00:00
|
|
|
/**
|
|
|
|
* Note: Appending of {@code RemoteVideo} views is handled through
|
|
|
|
* VideoLayout. The views do not get blown away on render() because
|
|
|
|
* ReactDOMComponent is only aware of the given JSX and not new appended
|
|
|
|
* DOM. As such, when updateDOMProperties gets called, only attributes
|
|
|
|
* will get updated without replacing the DOM. If the known DOM gets
|
|
|
|
* modified, then the views will get blown away.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const filmstripClassNames = `filmstrip ${this.props._remoteVideosVisible
|
|
|
|
? '' : 'hide-videos'}`;
|
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
return (
|
2017-08-12 00:27:30 +00:00
|
|
|
<div className = { filmstripClassNames }>
|
2017-07-06 02:07:00 +00:00
|
|
|
{ this.props.displayToolbox ? <Toolbox /> : null }
|
2017-05-24 17:01:46 +00:00
|
|
|
<div
|
|
|
|
className = 'filmstrip__videos'
|
|
|
|
id = 'remoteVideos'>
|
|
|
|
<div
|
|
|
|
className = 'filmstrip__videos'
|
|
|
|
id = 'filmstripLocalVideo'>
|
|
|
|
<span
|
|
|
|
className = 'videocontainer'
|
|
|
|
id = 'localVideoContainer'>
|
|
|
|
<div className = 'videocontainer__background' />
|
|
|
|
<span id = 'localVideoWrapper' />
|
|
|
|
<audio
|
|
|
|
autoPlay = { true }
|
|
|
|
id = 'localAudio'
|
|
|
|
muted = { true } />
|
|
|
|
<div className = 'videocontainer__toolbar' />
|
2017-07-10 22:29:44 +00:00
|
|
|
<div className = 'videocontainer__toptoolbar' />
|
2017-05-24 17:01:46 +00:00
|
|
|
<div className = 'videocontainer__hoverOverlay' />
|
2017-06-29 03:35:43 +00:00
|
|
|
<div className = 'displayNameContainer' />
|
2017-06-29 18:21:03 +00:00
|
|
|
<div className = 'avatar-container' />
|
2017-05-24 17:01:46 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className = 'filmstrip__videos'
|
|
|
|
id = 'filmstripRemoteVideos'>
|
2017-08-12 00:27:30 +00:00
|
|
|
{/**
|
2017-05-24 17:01:46 +00:00
|
|
|
* This extra video container is needed for scrolling
|
|
|
|
* thumbnails in Firefox; otherwise, the flex
|
|
|
|
* thumbnails resize instead of causing overflow.
|
|
|
|
*/}
|
|
|
|
<div
|
|
|
|
className = 'remote-videos-container'
|
|
|
|
id = 'filmstripRemoteVideosContainer' />
|
|
|
|
</div>
|
|
|
|
<audio
|
|
|
|
id = 'userJoined'
|
|
|
|
preload = 'auto'
|
|
|
|
src = 'sounds/joined.wav' />
|
|
|
|
<audio
|
|
|
|
id = 'userLeft'
|
|
|
|
preload = 'auto'
|
|
|
|
src = 'sounds/left.wav' />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-08-12 00:27:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated {@code Filmstrip}'s props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {{
|
|
|
|
* _remoteVideosVisible: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
const { remoteVideosVisible } = state['features/filmstrip'];
|
|
|
|
const { disable1On1Mode } = state['features/base/config'];
|
|
|
|
|
|
|
|
return {
|
|
|
|
_remoteVideosVisible: Boolean(remoteVideosVisible || disable1On1Mode)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(Filmstrip);
|