import React from 'react'; import { connect } from 'react-redux'; import ReactTooltip from 'react-tooltip'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { getDeviceInfo } from 'mediasoup-client'; import * as appPropTypes from '../appPropTypes'; import { withRoomContext } from '../../RoomContext'; import PeerView from '../VideoContainers/PeerView'; import ScreenView from '../VideoContainers/ScreenView'; class Me extends React.Component { state = { controlsVisible : false }; handleMouseOver = () => { this.setState({ controlsVisible : true }); }; handleMouseOut = () => { this.setState({ controlsVisible : false }); }; constructor(props) { super(props); this._mounted = false; this._rootNode = null; this._tooltip = true; // TODO: Issue when using react-tooltip in Edge: // https://github.com/wwayne/react-tooltip/issues/328 if (getDeviceInfo().flag === 'msedge') this._tooltip = false; } render() { const { roomClient, connected, me, advancedMode, micProducer, webcamProducer, screenProducer } = this.props; let micState; if (!me.canSendMic) micState = 'unsupported'; else if (!micProducer) micState = 'unsupported'; else if (!micProducer.locallyPaused && !micProducer.remotelyPaused) micState = 'on'; else micState = 'off'; let webcamState; if (!me.canSendWebcam) webcamState = 'unsupported'; else if (webcamProducer) webcamState = 'on'; else webcamState = 'off'; const videoVisible = ( Boolean(webcamProducer) && !webcamProducer.locallyPaused && !webcamProducer.remotelyPaused ); const screenVisible = ( Boolean(screenProducer) && !screenProducer.locallyPaused && !screenProducer.remotelyPaused ); let tip; if (!me.displayNameSet) tip = 'Click on your name to change it'; return (