is-natively-supported
v1.1.1
Published
A micro library for building extensions or fallbacks for modern, not fully supported browser APIs such as [Speech Recognition API](https://caniuse.com/#feat=speech-recognition)
Downloads
4
Readme
is-natively-supported
A micro library for building extensions or fallbacks for modern, not fully supported browser APIs such as Speech Recognition API
import IsNativelySupported from 'is-natively-supported'
class SpeechToText extends IsNativelySupported {
constructor() {
super('SpeechRecognition', 'webkitSpeechRecognition') // pass all known names to parent constructor
if(SpeechToText.isNativelySupported()) {
// register Speech Recognition API
} else {
// register fall back (Google, Watson, ...)
}
}
}