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

32 lines
814 B
React
Raw Normal View History

import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import Service from '/imports/ui/components/audio/service';
2017-10-23 20:41:09 +08:00
import PropTypes from 'prop-types';
import AudioTest from './component';
2017-10-23 20:41:09 +08:00
const propTypes = {
children: PropTypes.node,
};
const defaultProps = {
children: null,
};
const AudioTestContainer = props => (
<AudioTest {...props}>
{props.children}
</AudioTest>
);
2017-06-03 03:25:02 +08:00
export default createContainer(() => ({
outputDeviceId: Service.outputDeviceId(),
handlePlayAudioSample: (deviceId) => {
const sound = new Audio('resources/sounds/audioSample.mp3');
2017-10-23 20:41:09 +08:00
if (deviceId && sound.setSinkId) sound.setSinkId(deviceId);
sound.play();
2017-06-03 03:25:02 +08:00
},
}), AudioTestContainer);
2017-10-23 20:41:09 +08:00
AudioTestContainer.propTypes = propTypes;
AudioTestContainer.defaultProps = defaultProps;