bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/captions/select/container.jsx
Pedro Beschorner Marin d00909751a refactor(captions): change getVoices routine
In some cases, `getVoices` returns an empty array even if the browser's vendor
has full support for speech synthesis. Add a trigger call to initiate the
voices fetching process.

As drafted, `getVoices` can be an asynchronous call and monitoring it
depends on the support of a `voiceschanged` event. Although many of the
main vendors support voices, this event is not (yet) by Safari.

https://wicg.github.io/speech-api/#dom-speechsynthesis-getvoices
https://wicg.github.io/speech-api/#eventdef-speechsynthesis-voiceschanged
https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/voiceschanged_event
2022-07-20 17:20:50 +00:00

13 lines
405 B
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Service from '/imports/ui/components/audio/captions/speech/service';
import Select from './component';
const Container = (props) => <Select {...props} />;
export default withTracker(() => ({
enabled: Service.isEnabled(),
locale: Service.getSpeechLocale(),
voices: Service.getSpeechVoices(),
}))(Container);