bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/captions/speech/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

21 lines
388 B
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Service from './service';
import Speech from './component';
const Container = (props) => <Speech {...props} />;
export default withTracker(() => {
const {
locale,
connected,
talking,
} = Service.getStatus();
return {
locale,
connected,
talking,
};
})(Container);