bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio-modal/audio-settings/component.jsx

88 lines
2.7 KiB
React
Raw Normal View History

import React from 'react';
import Button from '/imports/ui/components/button/component';
import { clearModal } from '/imports/ui/components/app/service';
import styles from '../styles.scss';
import DeviceSelector from '/imports/ui/components/audio/device-selector/component';
import AudioStreamVolume from '/imports/ui/components/audio/audio-stream-volume/component';
2016-12-06 09:37:46 +08:00
import EnterAudioContainer from '/imports/ui/components/enter-audio/container';
import AudioTestContainer from '/imports/ui/components/audio-test/container';
export default 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.handleClose = this.handleClose.bind(this);
this.state = {
inputDeviceId: undefined,
}
}
chooseAudio() {
this.props.changeMenu(this.props.JOIN_AUDIO);
}
handleInputChange(deviceId) {
console.log(`INPUT DEVICE CHANGED: ${deviceId}`);
this.setState({
inputDeviceId: deviceId
});
}
handleOutputChange(deviceId) {
console.log(`OUTPUT DEVICE CHANGED: ${deviceId}`);
}
handleClose() {
this.setState({ isOpen: false });
clearModal();
}
render() {
return (
<div>
<div className={styles.center}>
<Button className={styles.backBtn}
label={'Back'}
icon={'left-arrow'}
size={'md'}
color={'primary'}
ghost={true}
onClick={this.chooseAudio}
/>
2016-12-23 03:32:26 +08:00
<div className={styles.title}>
Choose your audio settings
</div>
</div>
2016-12-23 03:32:26 +08:00
<div className={styles.audioNote}>
Please note, a dialog will appear in your browser, requiring you to accept sharing your microphone.
</div>
2016-12-06 00:21:55 +08:00
<div className={styles.containerLeftHalfContent}>
2016-12-23 03:32:26 +08:00
<span className={styles.heading}>Microphone source</span>
<DeviceSelector
2016-12-23 05:01:56 +08:00
className={styles.item}
kind="audioinput"
onChange={this.handleInputChange} />
2016-12-23 23:06:45 +08:00
<span className={styles.heading}>Your audio stream volume</span>
<AudioStreamVolume
2016-12-23 05:01:56 +08:00
className={styles.item}
deviceId={this.state.inputDeviceId} />
</div>
2016-12-06 00:21:55 +08:00
<div className={styles.containerRightHalfContent}>
2016-12-23 23:06:45 +08:00
<span className={styles.heading}>Speaker source</span>
<DeviceSelector
className={styles.item}
kind="audiooutput"
onChange={this.handleOutputChange} />
<AudioTestContainer />
2016-12-06 09:37:46 +08:00
<EnterAudioContainer isFullAudio={true}/>
</div>
</div>
);
}
};