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

17 lines
722 B
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Service from '/imports/ui/components/audio/service';
import AudioTest from './component';
2021-08-09 22:24:02 +08:00
const AudioTestContainer = (props) => <AudioTest {...props} />;
export default withTracker(() => ({
outputDeviceId: Service.outputDeviceId(),
handlePlayAudioSample: (deviceId) => {
2020-12-01 00:09:35 +08:00
const sound = new Audio(`${Meteor.settings.public.app.cdn + Meteor.settings.public.app.basename + Meteor.settings.public.app.instanceId}/resources/sounds/audioSample.mp3`);
sound.addEventListener('ended', () => { sound.src = null; });
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);