2017-02-07 14:45:51 +00:00
|
|
|
/* @flow */
|
2017-01-10 21:55:31 +00:00
|
|
|
|
2017-10-11 05:45:20 +00:00
|
|
|
import _ from 'lodash';
|
2017-09-27 21:23:31 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2016-11-23 21:46:46 +00:00
|
|
|
import React, { Component } from 'react';
|
2016-12-12 21:13:17 +00:00
|
|
|
import { connect as reactReduxConnect } from 'react-redux';
|
|
|
|
|
2017-01-10 21:55:31 +00:00
|
|
|
import { connect, disconnect } from '../../base/connection';
|
2017-03-07 03:34:51 +00:00
|
|
|
import { DialogContainer } from '../../base/dialog';
|
2017-05-24 17:01:46 +00:00
|
|
|
import { Filmstrip } from '../../filmstrip';
|
|
|
|
import { LargeVideo } from '../../large-video';
|
2017-07-28 17:56:49 +00:00
|
|
|
import { NotificationsContainer } from '../../notifications';
|
2017-01-31 20:58:48 +00:00
|
|
|
import { OverlayContainer } from '../../overlay';
|
2017-10-11 05:45:20 +00:00
|
|
|
import { showToolbox, Toolbox } from '../../toolbox';
|
2017-02-21 22:24:47 +00:00
|
|
|
import { HideNotificationBarStyle } from '../../unsupported-browser';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2017-02-07 14:45:51 +00:00
|
|
|
declare var $: Function;
|
|
|
|
declare var APP: Object;
|
2017-07-06 02:07:00 +00:00
|
|
|
declare var interfaceConfig: Object;
|
2017-02-07 14:45:51 +00:00
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
2017-02-02 16:49:14 +00:00
|
|
|
* The conference page of the Web application.
|
2016-11-23 21:46:46 +00:00
|
|
|
*/
|
2017-10-24 22:26:56 +00:00
|
|
|
class Conference extends Component<*> {
|
2017-10-11 05:45:20 +00:00
|
|
|
_onShowToolbar: Function;
|
|
|
|
_originalOnShowToolbar: Function;
|
2017-01-10 21:55:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Conference component's property types.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*/
|
|
|
|
static propTypes = {
|
2017-09-27 21:23:31 +00:00
|
|
|
dispatch: PropTypes.func
|
2017-06-02 02:01:50 +00:00
|
|
|
};
|
2017-01-10 21:55:31 +00:00
|
|
|
|
2017-10-11 05:45:20 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new Conference instance.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The read-only properties with which the new
|
|
|
|
* instance is to be initialized.
|
|
|
|
*/
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
// Throttle and bind this component's mousemove handler to prevent it
|
|
|
|
// from firing too often.
|
|
|
|
this._originalOnShowToolbar = this._onShowToolbar;
|
|
|
|
this._onShowToolbar = _.throttle(
|
|
|
|
() => this._originalOnShowToolbar(),
|
|
|
|
100,
|
|
|
|
{
|
|
|
|
leading: true,
|
|
|
|
trailing: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2016-12-12 21:13:17 +00:00
|
|
|
/**
|
|
|
|
* Until we don't rewrite UI using react components
|
|
|
|
* we use UI.start from old app. Also method translates
|
|
|
|
* component right after it has been mounted.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
|
|
|
APP.UI.start();
|
|
|
|
|
2017-02-15 21:39:16 +00:00
|
|
|
APP.UI.registerListeners();
|
|
|
|
APP.UI.bindEvents();
|
|
|
|
|
2016-12-12 21:13:17 +00:00
|
|
|
this.props.dispatch(connect());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disconnect from the conference when component will be
|
|
|
|
* unmounted.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
componentWillUnmount() {
|
2017-05-11 00:19:35 +00:00
|
|
|
APP.UI.stopDaemons();
|
2017-02-15 21:39:16 +00:00
|
|
|
APP.UI.unregisterListeners();
|
|
|
|
APP.UI.unbindEvents();
|
|
|
|
|
2017-02-02 16:01:03 +00:00
|
|
|
APP.conference.isJoined() && this.props.dispatch(disconnect());
|
2016-12-12 21:13:17 +00:00
|
|
|
}
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2017-07-06 02:07:00 +00:00
|
|
|
const { filmStripOnly } = interfaceConfig;
|
|
|
|
|
2016-11-23 21:46:46 +00:00
|
|
|
return (
|
2017-10-11 05:45:20 +00:00
|
|
|
<div
|
|
|
|
id = 'videoconference_page'
|
|
|
|
onMouseMove = { this._onShowToolbar }>
|
2016-11-23 21:46:46 +00:00
|
|
|
<div id = 'videospace'>
|
2017-05-24 17:01:46 +00:00
|
|
|
<LargeVideo />
|
2017-10-03 16:30:42 +00:00
|
|
|
<Filmstrip filmstripOnly = { filmStripOnly } />
|
2016-11-23 21:46:46 +00:00
|
|
|
</div>
|
2017-02-16 23:02:40 +00:00
|
|
|
|
2017-07-06 02:07:00 +00:00
|
|
|
{ filmStripOnly ? null : <Toolbox /> }
|
2017-05-24 17:01:46 +00:00
|
|
|
|
2017-03-07 03:34:51 +00:00
|
|
|
<DialogContainer />
|
2017-08-02 18:15:55 +00:00
|
|
|
<NotificationsContainer />
|
2017-01-31 20:58:48 +00:00
|
|
|
<OverlayContainer />
|
2017-05-17 21:05:48 +00:00
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
{/*
|
|
|
|
* Temasys automatically injects a notification bar, if
|
|
|
|
* necessary, displayed at the top of the page notifying that
|
|
|
|
* WebRTC is not installed or supported. We do not need/want
|
|
|
|
* the notification bar in question because we have whole pages
|
|
|
|
* dedicated to the respective scenarios.
|
|
|
|
*/}
|
|
|
|
<HideNotificationBarStyle />
|
2017-05-17 21:05:48 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-10-11 05:45:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays the toolbar.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onShowToolbar() {
|
|
|
|
this.props.dispatch(showToolbox());
|
|
|
|
}
|
2016-11-23 21:46:46 +00:00
|
|
|
}
|
2016-12-12 21:13:17 +00:00
|
|
|
|
|
|
|
export default reactReduxConnect()(Conference);
|