{"size": 1416, "ext": "js", "max_stars_repo_path": "packages/node_modules/@webex/widget-meetings/src/components/ActiveMeeting.js", "max_stars_repo_name": "https-maxus-github-com/react-widgets", "max_stars_repo_stars_event_min_datetime": "2019-10-18T11:53:44.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-18T11:53:44.000Z", "max_issues_repo_path": "packages/node_modules/@webex/widget-meetings/src/components/ActiveMeeting.js", "max_issues_repo_name": "https-maxus-github-com/react-widgets", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/node_modules/@webex/widget-meetings/src/components/ActiveMeeting.js", "max_forks_repo_name": "https-maxus-github-com/react-widgets", "max_forks_repo_forks_event_min_datetime": "2019-10-18T11:53:51.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-18T11:53:51.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.2131147541, "max_line_length": 91, "alphanum_fraction": 0.6913841808}
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import Video from '@ciscospark/react-component-video';
import ButtonControls from '@ciscospark/react-component-button-controls';

import styles from './ActiveMeeting.css';

const propTypes = {
  localVideoStream: PropTypes.object,
  onLeaveClick: PropTypes.func.isRequired,
  remoteVideoStream: PropTypes.object
};

const defaultProps = {
  localVideoStream: undefined,
  remoteVideoStream: undefined
};

function ActiveMeeting(
  {
    localVideoStream,
    remoteVideoStream,
    onLeaveClick
  }
) {
  const controls = [];

  controls.push({
    accessibilityLabel: 'Hangup',
    buttonType: 'cancel',
    callControl: true,
    onClick: onLeaveClick
  });

  return (
    <div>
      {
        localVideoStream &&
        <div className={classNames(styles.localVideo, 'webex-meeting-active-local-video')}>
          <Video audioMuted srcObject={localVideoStream} />
        </div>
      }
      {
        remoteVideoStream && remoteVideoStream.active &&
        <Video srcObject={remoteVideoStream} />
      }
      <div className={classNames(styles.meetingControls, 'webex-meeting-active-controls')}>
        <ButtonControls buttons={controls} showLabels={false} />
      </div>
    </div>
  );
}

ActiveMeeting.propTypes = propTypes;
ActiveMeeting.defaultProps = defaultProps;

export default ActiveMeeting;

