| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 | 
							- import PropTypes from 'prop-types';
 - import React, { Component } from 'react';
 - import { connect } from 'react-redux';
 - 
 - import { CallOverlay } from '../../base/jwt';
 - 
 - import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
 - import PageReloadOverlay from './PageReloadOverlay';
 - import SuspendedFilmstripOnlyOverlay from './SuspendedFilmstripOnlyOverlay';
 - import SuspendedOverlay from './SuspendedOverlay';
 - import UserMediaPermissionsFilmstripOnlyOverlay
 -     from './UserMediaPermissionsFilmstripOnlyOverlay';
 - import UserMediaPermissionsOverlay from './UserMediaPermissionsOverlay';
 - 
 - declare var interfaceConfig: Object;
 - 
 - /**
 -  * Implements a React Component that will display the correct overlay when
 -  * needed.
 -  */
 - class OverlayContainer extends Component {
 -     /**
 -      * OverlayContainer component's property types.
 -      *
 -      * @static
 -      */
 -     static propTypes = {
 -         /**
 -          * The browser which is used currently.
 -          *
 -          * NOTE: Used by UserMediaPermissionsOverlay only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _browser: PropTypes.string,
 - 
 -         /**
 -          * The indicator which determines whether the {@link CallOverlay} is
 -          * displayed/visible.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _callOverlayVisible: PropTypes.bool,
 - 
 -         /**
 -          * The indicator which determines whether the status of the
 -          * JitsiConnection object has been "established" or not.
 -          *
 -          * NOTE: Used by PageReloadOverlay only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _connectionEstablished: PropTypes.bool,
 - 
 -         /**
 -          * The indicator which determines whether a critical error for reload
 -          * has been received.
 -          *
 -          * NOTE: Used by PageReloadOverlay only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _haveToReload: PropTypes.bool,
 - 
 -         /**
 -          * The indicator which determines whether the GUM permissions prompt is
 -          * displayed or not.
 -          *
 -          * NOTE: Used by UserMediaPermissionsOverlay only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _isMediaPermissionPromptVisible: PropTypes.bool,
 - 
 -         /**
 -          * The indicator which determines whether the reload was caused by
 -          * network failure.
 -          *
 -          * NOTE: Used by PageReloadOverlay only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _isNetworkFailure: PropTypes.bool,
 - 
 -         /**
 -          * The reason for the error that will cause the reload.
 -          *
 -          * NOTE: Used by PageReloadOverlay only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _reason: PropTypes.string,
 - 
 -         /**
 -          * The indicator which determines whether the GUM permissions prompt is
 -          * displayed or not.
 -          *
 -          * NOTE: Used by SuspendedOverlay only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _suspendDetected: PropTypes.bool
 -     };
 - 
 -     /**
 -      * Initializes a new ReloadTimer instance.
 -      *
 -      * @param {Object} props - The read-only properties with which the new
 -      * instance is to be initialized.
 -      * @public
 -      */
 -     constructor(props) {
 -         super(props);
 - 
 -         this.state = {
 -             /**
 -              * The indicator which determines whether filmstrip-only mode is
 -              * enabled.
 -              *
 -              * @type {boolean}
 -              */
 -             filmstripOnly:
 -                 typeof interfaceConfig === 'object'
 -                     && interfaceConfig.filmStripOnly
 -         };
 -     }
 - 
 -     /**
 -      * Implements React's {@link Component#render()}.
 -      *
 -      * @inheritdoc
 -      * @returns {ReactElement|null}
 -      * @public
 -      */
 -     render() {
 -         const { filmstripOnly } = this.state;
 -         let overlayComponent, props;
 - 
 -         if (this.props._connectionEstablished && this.props._haveToReload) {
 -             overlayComponent
 -                 = filmstripOnly
 -                     ? PageReloadFilmstripOnlyOverlay
 -                     : PageReloadOverlay;
 -             props = {
 -                 isNetworkFailure: this.props._isNetworkFailure,
 -                 reason: this.props._reason
 -             };
 -         } else if (this.props._suspendDetected) {
 -             overlayComponent
 -                 = filmstripOnly
 -                     ? SuspendedFilmstripOnlyOverlay
 -                     : SuspendedOverlay;
 -         } else if (this.props._isMediaPermissionPromptVisible) {
 -             overlayComponent
 -                 = filmstripOnly
 -                     ? UserMediaPermissionsFilmstripOnlyOverlay
 -                     : UserMediaPermissionsOverlay;
 -             props = {
 -                 browser: this.props._browser
 -             };
 -         } else if (this.props._callOverlayVisible) {
 -             overlayComponent = CallOverlay;
 -         }
 - 
 -         return (
 -             overlayComponent
 -                 ? React.createElement(overlayComponent, props)
 -                 : null);
 -     }
 - }
 - 
 - /**
 -  * Maps (parts of) the redux state to the associated OverlayContainer's props.
 -  *
 -  * @param {Object} state - The redux state.
 -  * @returns {{
 -  *     _browser: string,
 -  *     _callOverlayVisible: boolean,
 -  *     _connectionEstablished: boolean,
 -  *     _haveToReload: boolean,
 -  *     _isNetworkFailure: boolean,
 -  *     _isMediaPermissionPromptVisible: boolean,
 -  *     _reason: string,
 -  *     _suspendDetected: boolean
 -  * }}
 -  * @private
 -  */
 - function _mapStateToProps(state) {
 -     const stateFeaturesOverlay = state['features/overlay'];
 - 
 -     return {
 -         /**
 -          * The browser which is used currently.
 -          *
 -          * NOTE: Used by {@link UserMediaPermissionsOverlay} only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _browser: stateFeaturesOverlay.browser,
 - 
 -         /**
 -          * The indicator which determines whether the {@link CallOverlay} is
 -          * displayed/visible.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _callOverlayVisible:
 -             Boolean(state['features/base/jwt'].callOverlayVisible),
 - 
 -         /**
 -          * The indicator which determines whether the status of the
 -          * JitsiConnection object has been "established" or not.
 -          *
 -          * NOTE: Used by {@link PageReloadOverlay} only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _connectionEstablished: stateFeaturesOverlay.connectionEstablished,
 - 
 -         /**
 -          * The indicator which determines whether a critical error for reload
 -          * has been received.
 -          *
 -          * NOTE: Used by {@link PageReloadOverlay} only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _haveToReload: stateFeaturesOverlay.haveToReload,
 - 
 -         /**
 -          * The indicator which determines whether the GUM permissions prompt is
 -          * displayed or not.
 -          *
 -          * NOTE: Used by {@link UserMediaPermissionsOverlay} only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _isMediaPermissionPromptVisible:
 -             stateFeaturesOverlay.isMediaPermissionPromptVisible,
 - 
 -         /**
 -          * The indicator which determines whether the reload was caused by
 -          * network failure.
 -          *
 -          * NOTE: Used by {@link PageReloadOverlay} only.
 -          *
 -          * @private
 -          * @type {boolean}
 -          */
 -         _isNetworkFailure: stateFeaturesOverlay.isNetworkFailure,
 - 
 -         /**
 -          * The reason for the error that will cause the reload.
 -          *
 -          * NOTE: Used by {@link PageReloadOverlay} only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _reason: stateFeaturesOverlay.reason,
 - 
 -         /**
 -          * The indicator which determines whether the GUM permissions prompt is
 -          * displayed or not.
 -          *
 -          * NOTE: Used by {@link SuspendedOverlay} only.
 -          *
 -          * @private
 -          * @type {string}
 -          */
 -         _suspendDetected: stateFeaturesOverlay.suspendDetected
 -     };
 - }
 - 
 - export default connect(_mapStateToProps)(OverlayContainer);
 
 
  |