bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/audio-test/component.jsx
Ramón Souza 7514066fc3
fix: Client can't load in certain cases (#20336)
* move settings

* remove meteor cache files
2024-05-29 09:26:11 -04:00

59 lines
1.3 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import Styled from './styles';
import { getSettingsSingletonInstance } from '/imports/ui/services/settings';
const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).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',
},
});
class AudioTest extends React.Component {
constructor(props) {
super(props);
this.handlePlayAudioSample = props.handlePlayAudioSample.bind(this);
}
render() {
const {
outputDeviceId,
intl,
} = this.props;
const Settings = getSettingsSingletonInstance();
const { animations } = Settings.application;
return (
<Styled.TestAudioButton
label={intl.formatMessage(intlMessages.playSoundLabel)}
icon="unmute"
size="sm"
color="primary"
onClick={() => this.handlePlayAudioSample(outputDeviceId)}
animations={animations}
/>
);
}
}
AudioTest.propTypes = propTypes;
AudioTest.defaultProps = defaultProps;
export default injectIntl(AudioTest);