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

58 lines
1.3 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';
import { defineMessages, injectIntl } from 'react-intl';
2021-11-09 22:38:28 +08:00
import Styled from './styles';
import Settings from '/imports/ui/services/settings';
2017-10-23 20:41:09 +08:00
const propTypes = {
2021-08-09 22:24:02 +08:00
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
2017-10-23 20:41:09 +08:00
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;
2021-11-09 22:38:28 +08:00
const { animations } = Settings.application;
return (
2021-11-09 22:38:28 +08:00
<Styled.TestAudioButton
label={intl.formatMessage(intlMessages.playSoundLabel)}
2021-08-09 22:24:02 +08:00
icon="unmute"
size="sm"
color="primary"
onClick={() => this.handlePlayAudioSample(outputDeviceId)}
2021-11-09 22:38:28 +08:00
animations={animations}
/>
);
}
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);