d00909751a
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
21 lines
388 B
JavaScript
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);
|