2018-08-23 19:57:12 +00:00
|
|
|
// @flow
|
2017-05-24 17:01:46 +00:00
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { Watermarks } from '../../base/react';
|
2019-10-08 09:34:25 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2020-03-11 09:45:42 +00:00
|
|
|
import { InviteMore, Subject } from '../../conference';
|
2020-05-22 06:36:24 +00:00
|
|
|
import { fetchCustomBrandingData } from '../../dynamic-branding';
|
2020-05-20 10:57:03 +00:00
|
|
|
import { Captions } from '../../subtitles/';
|
2018-05-16 14:00:16 +00:00
|
|
|
|
2017-08-09 19:40:03 +00:00
|
|
|
declare var interfaceConfig: Object;
|
2017-05-24 17:01:46 +00:00
|
|
|
|
2019-10-08 09:34:25 +00:00
|
|
|
type Props = {
|
|
|
|
|
2020-05-22 06:36:24 +00:00
|
|
|
/**
|
|
|
|
* The user selected background color.
|
|
|
|
*/
|
|
|
|
_customBackgroundColor: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The user selected background image url.
|
|
|
|
*/
|
|
|
|
_customBackgroundImageUrl: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fetches the branding data.
|
|
|
|
*/
|
|
|
|
_fetchCustomBrandingData: Function,
|
|
|
|
|
2020-03-11 09:45:42 +00:00
|
|
|
/**
|
|
|
|
* Prop that indicates whether the chat is open.
|
|
|
|
*/
|
|
|
|
_isChatOpen: boolean,
|
|
|
|
|
2019-10-08 09:34:25 +00:00
|
|
|
/**
|
|
|
|
* Used to determine the value of the autoplay attribute of the underlying
|
|
|
|
* video element.
|
|
|
|
*/
|
|
|
|
_noAutoPlayVideo: boolean
|
|
|
|
}
|
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
/**
|
|
|
|
* Implements a React {@link Component} which represents the large video (a.k.a.
|
|
|
|
* the conference participant who is on the local stage) on Web/React.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
2019-10-08 09:34:25 +00:00
|
|
|
class LargeVideo extends Component<Props> {
|
2020-05-22 06:36:24 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#componentDidMount}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
componentDidMount() {
|
|
|
|
this.props._fetchCustomBrandingData();
|
|
|
|
}
|
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
2018-08-23 19:57:12 +00:00
|
|
|
* @returns {React$Element}
|
2017-05-24 17:01:46 +00:00
|
|
|
*/
|
|
|
|
render() {
|
2020-05-22 06:36:24 +00:00
|
|
|
const style = this._getCustomSyles();
|
2020-03-11 09:45:42 +00:00
|
|
|
const className = `videocontainer${this.props._isChatOpen ? ' shift-right' : ''}`;
|
2020-05-22 06:36:24 +00:00
|
|
|
|
2017-05-24 17:01:46 +00:00
|
|
|
return (
|
|
|
|
<div
|
2020-03-11 09:45:42 +00:00
|
|
|
className = { className }
|
2020-05-22 06:36:24 +00:00
|
|
|
id = 'largeVideoContainer'
|
|
|
|
style = { style }>
|
2020-03-11 09:45:42 +00:00
|
|
|
<Subject />
|
|
|
|
<InviteMore />
|
2017-05-24 17:01:46 +00:00
|
|
|
<div id = 'sharedVideo'>
|
|
|
|
<div id = 'sharedVideoIFrame' />
|
|
|
|
</div>
|
|
|
|
<div id = 'etherpad' />
|
|
|
|
|
|
|
|
<Watermarks />
|
|
|
|
|
|
|
|
<div id = 'dominantSpeaker'>
|
|
|
|
<div className = 'dynamic-shadow' />
|
2019-02-07 03:19:02 +00:00
|
|
|
<div id = 'dominantSpeakerAvatarContainer' />
|
2017-05-24 17:01:46 +00:00
|
|
|
</div>
|
2017-07-31 23:33:22 +00:00
|
|
|
<div id = 'remotePresenceMessage' />
|
2017-05-24 17:01:46 +00:00
|
|
|
<span id = 'remoteConnectionMessage' />
|
2018-08-08 18:48:23 +00:00
|
|
|
<div id = 'largeVideoElementsContainer'>
|
2018-02-13 00:29:29 +00:00
|
|
|
<div id = 'largeVideoBackgroundContainer' />
|
2017-06-20 21:40:18 +00:00
|
|
|
|
2018-08-23 19:57:12 +00:00
|
|
|
{/*
|
|
|
|
* FIXME: the architecture of elements related to the large
|
|
|
|
* video and the naming. The background is not part of
|
|
|
|
* largeVideoWrapper because we are controlling the size of
|
|
|
|
* the video through largeVideoWrapper. That's why we need
|
|
|
|
* another container for the background and the
|
|
|
|
* largeVideoWrapper in order to hide/show them.
|
|
|
|
*/}
|
2017-06-20 21:40:18 +00:00
|
|
|
<div id = 'largeVideoWrapper'>
|
|
|
|
<video
|
2019-10-08 09:34:25 +00:00
|
|
|
autoPlay = { !this.props._noAutoPlayVideo }
|
2017-06-20 21:40:18 +00:00
|
|
|
id = 'largeVideo'
|
2020-04-14 16:05:03 +00:00
|
|
|
muted = { true }
|
|
|
|
playsInline = { true } /* for Safari on iOS to work */ />
|
2017-06-20 21:40:18 +00:00
|
|
|
</div>
|
2017-05-24 17:01:46 +00:00
|
|
|
</div>
|
2018-07-17 17:31:12 +00:00
|
|
|
{ interfaceConfig.DISABLE_TRANSCRIPTION_SUBTITLES
|
2018-08-23 19:57:12 +00:00
|
|
|
|| <Captions /> }
|
2017-05-24 17:01:46 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2020-05-22 06:36:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates the custom styles object.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
|
|
|
_getCustomSyles() {
|
|
|
|
const styles = {};
|
|
|
|
const { _customBackgroundColor, _customBackgroundImageUrl } = this.props;
|
|
|
|
|
|
|
|
styles.backgroundColor = _customBackgroundColor || interfaceConfig.DEFAULT_BACKGROUND;
|
|
|
|
|
|
|
|
if (_customBackgroundImageUrl) {
|
|
|
|
styles.backgroundImage = `url(${_customBackgroundImageUrl})`;
|
|
|
|
styles.backgroundSize = 'cover';
|
|
|
|
}
|
|
|
|
|
|
|
|
return styles;
|
|
|
|
}
|
2017-05-24 17:01:46 +00:00
|
|
|
}
|
2019-10-08 09:34:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated LargeVideo props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @private
|
2020-05-22 06:36:24 +00:00
|
|
|
* @returns {Props}
|
2019-10-08 09:34:25 +00:00
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
const testingConfig = state['features/base/config'].testing;
|
2020-05-22 06:36:24 +00:00
|
|
|
const { backgroundColor, backgroundImageUrl } = state['features/dynamic-branding'];
|
2020-03-11 09:45:42 +00:00
|
|
|
const { isOpen: isChatOpen } = state['features/chat'];
|
2019-10-08 09:34:25 +00:00
|
|
|
|
|
|
|
return {
|
2020-05-22 06:36:24 +00:00
|
|
|
_customBackgroundColor: backgroundColor,
|
|
|
|
_customBackgroundImageUrl: backgroundImageUrl,
|
2020-03-11 09:45:42 +00:00
|
|
|
_isChatOpen: isChatOpen,
|
2019-10-08 09:34:25 +00:00
|
|
|
_noAutoPlayVideo: testingConfig?.noAutoPlayVideo
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-05-22 06:36:24 +00:00
|
|
|
const _mapDispatchToProps = {
|
|
|
|
_fetchCustomBrandingData: fetchCustomBrandingData
|
|
|
|
};
|
2019-10-08 09:34:25 +00:00
|
|
|
|
2020-05-22 06:36:24 +00:00
|
|
|
export default connect(_mapStateToProps, _mapDispatchToProps)(LargeVideo);
|