import React from 'react'; import { defineMessages, injectIntl } from 'react-intl'; import Button from '/imports/ui/components/button/component'; import { withModalMounter } from '/imports/ui/components/modal/service'; import DeviceSelector from '/imports/ui/components/audio/device-selector/component'; import AudioStreamVolume from '/imports/ui/components/audio/audio-stream-volume/component'; import EnterAudioContainer from '/imports/ui/components/audio/enter-audio/container'; import AudioTestContainer from '/imports/ui/components/audio/audio-test/container'; import cx from 'classnames'; import styles from './styles'; const intlMessages = defineMessages({ backLabel: { id: 'app.audio.backLabel', description: 'audio settings back button label', }, titleLabel: { id: 'app.audio.audioSettings.titleLabel', description: 'audio setting title label', }, descriptionLabel: { id: 'app.audio.audioSettings.descriptionLabel', description: 'audio settings description label', }, micSourceLabel: { id: 'app.audio.audioSettings.microphoneSourceLabel', description: 'Label for mic source', }, speakerSourceLabel: { id: 'app.audio.audioSettings.speakerSourceLabel', description: 'Label for speaker source', }, streamVolumeLabel: { id: 'app.audio.audioSettings.microphoneStreamLabel', description: 'Label for stream volume', }, enterSessionLabel: { id: 'app.audio.enterSessionLabel', description: 'enter session button label', }, }); class AudioSettings extends React.Component { constructor(props) { super(props); this.chooseAudio = this.chooseAudio.bind(this); this.handleInputChange = this.handleInputChange.bind(this); this.handleOutputChange = this.handleOutputChange.bind(this); this.handleBack = props.handleBack; this.handleJoin = props.handleJoin; this.joinEchoTest = props.joinEchoTest; this.exitAudio = props.exitAudio; this.changeInputDevice = props.changeInputDevice; console.log('inputDeviceId', props.inputDeviceId); this.state = { inputDeviceId: props.inputDeviceId, outputDeviceId: undefined, }; } componentDidMount() { // this.joinEchoTest(); } componentWillUnmount() { const { isEchoTest, } = this.props; if (isEchoTest) { this.exitAudio(); } } chooseAudio() { this.props.changeMenu(this.props.JOIN_AUDIO); } handleInputChange(deviceId, device) { console.log(`INPUT DEVICE CHANGED: ${deviceId}`); console.log(device); this.changeInputDevice(deviceId); this.setState({ inputDeviceId: deviceId, }); } handleOutputChange(deviceId, device) { console.log(`OUTPUT DEVICE CHANGED: ${deviceId}`); console.log(device); this.setState({ outputDeviceId: deviceId, }); } // handleClose() { // this.setState({ isOpen: false }); // this.props.mountModal(null); // } render() { const { isConnecting, intl, } = this.props; // return this.renderCalling(); return (