diff --git a/app/lib/components/FullScreenView.jsx b/app/lib/components/FullScreenView.jsx new file mode 100644 index 0000000..6192eee --- /dev/null +++ b/app/lib/components/FullScreenView.jsx @@ -0,0 +1,91 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import PropTypes from 'prop-types'; +import classnames from 'classnames'; +import * as appPropTypes from './appPropTypes'; +import * as stateActions from '../redux/stateActions'; +import FullView from './FullView'; + +const FullScreenView = (props) => +{ + const { + advancedMode, + consumer, + toggleConsumerFullscreen + } = props; + + if (!consumer) + return null; + + const consumerVisible = ( + Boolean(consumer) && + !consumer.locallyPaused && + !consumer.remotelyPaused + ); + + let consumerProfile; + + if (consumer) + consumerProfile = consumer.profile; + + return ( +
+ {consumerVisible && !consumer.supported ? +
+

incompatible video

+
+ :null + } + +
+
+ { + e.stopPropagation(); + toggleConsumerFullscreen(consumer); + }} + /> +
+ + +
+ ); +}; + +FullScreenView.propTypes = +{ + advancedMode : PropTypes.bool, + consumer : appPropTypes.Consumer, + toggleConsumerFullscreen : PropTypes.func.isRequired +}; + +const mapStateToProps = (state) => +{ + return { + consumer : state.consumers[state.room.fullScreenConsumer] + }; +}; + +const mapDispatchToProps = (dispatch) => +{ + return { + toggleConsumerFullscreen : (consumer) => + { + if (consumer) + dispatch(stateActions.toggleConsumerFullscreen(consumer.id)); + } + }; +}; + +const FullScreenViewContainer = connect( + mapStateToProps, + mapDispatchToProps +)(FullScreenView); + +export default FullScreenViewContainer; diff --git a/app/lib/components/FullView.jsx b/app/lib/components/FullView.jsx index fec212c..3edc64a 100644 --- a/app/lib/components/FullView.jsx +++ b/app/lib/components/FullView.jsx @@ -22,7 +22,7 @@ export default class FullView extends React.Component } = this.props; return ( -
+