import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import Spinner from 'react-spinner'; import hark from 'hark'; import * as appPropTypes from './appPropTypes'; import EditableInput from './EditableInput'; export default class PeerView extends React.Component { constructor(props) { super(props); this.state = { volume : 0, // Integer from 0 to 10., videoWidth : null, videoHeight : null }; // Latest received video track. // @type {MediaStreamTrack} this._audioTrack = null; // Latest received video track. // @type {MediaStreamTrack} this._videoTrack = null; // Hark instance. // @type {Object} this._hark = null; // Periodic timer for showing video resolution. this._videoResolutionTimer = null; } render() { const { isMe, peer, advancedMode, videoVisible, videoProfile, audioCodec, videoCodec, onChangeDisplayName } = this.props; const { volume, videoWidth, videoHeight } = this.state; return (
{advancedMode ?
{audioCodec ?

{audioCodec}

:null } {videoCodec ?

{videoCodec} {videoProfile}

:null } {(videoVisible && videoWidth !== null) ?

{videoWidth}x{videoHeight}

:null }
:null }
{isMe ? onChangeDisplayName(displayName)} /> : {peer.displayName} } {advancedMode ?
{peer.device.name} {Math.floor(peer.device.version) || null}
:null }