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

54 lines
1.2 KiB
React
Raw Normal View History

2017-03-02 09:03:02 +08:00
import React from 'react';
2017-10-23 20:41:09 +08:00
import PropTypes from 'prop-types';
2017-03-02 09:03:02 +08:00
import Button from '/imports/ui/components/button/component';
2017-10-23 20:41:09 +08:00
import { defineMessages, intlShape, injectIntl } from 'react-intl';
2018-01-08 14:17:18 +08:00
import { styles } from './styles.scss';
2017-10-23 20:41:09 +08:00
const propTypes = {
intl: intlShape.isRequired,
handlePlayAudioSample: PropTypes.func.isRequired,
outputDeviceId: PropTypes.string,
};
const defaultProps = {
outputDeviceId: null,
};
const intlMessages = defineMessages({
playSoundLabel: {
id: 'app.audio.playSoundLabel',
description: 'Play sound button label',
},
});
2017-03-02 09:03:02 +08:00
class AudioTest extends React.Component {
constructor(props) {
super(props);
this.handlePlayAudioSample = props.handlePlayAudioSample.bind(this);
}
render() {
const {
outputDeviceId,
intl,
} = this.props;
return (
2017-06-03 03:25:02 +08:00
<Button
className={styles.testAudioBtn}
label={intl.formatMessage(intlMessages.playSoundLabel)}
icon={'unmute'}
size={'sm'}
color={'primary'}
onClick={() => this.handlePlayAudioSample(outputDeviceId)}
/>
);
}
2017-06-03 03:25:02 +08:00
}
2017-10-23 20:41:09 +08:00
AudioTest.propTypes = propTypes;
AudioTest.defaultProps = defaultProps;
export default injectIntl(AudioTest);