2016-02-23 12:57:38 -05:00
|
|
|
define([], function () {
|
2015-06-02 01:46:06 -04:00
|
|
|
|
2016-02-23 12:53:04 -05:00
|
|
|
return {
|
2015-06-02 01:46:06 -04:00
|
|
|
|
|
|
|
isSupported: function () {
|
2015-06-02 13:46:44 -04:00
|
|
|
|
2015-12-14 10:43:03 -05:00
|
|
|
if (AppInfo.isNativeApp) {
|
2016-02-17 07:58:07 +01:00
|
|
|
// Crashes on some amazon devices
|
|
|
|
if (window.device && (device.platform || '').toLowerCase().indexOf('amazon') != -1) {
|
|
|
|
return false;
|
|
|
|
}
|
2015-12-14 10:43:03 -05:00
|
|
|
}
|
|
|
|
|
2016-02-17 07:58:07 +01:00
|
|
|
return window.SpeechRecognition ||
|
|
|
|
window.webkitSpeechRecognition ||
|
|
|
|
window.mozSpeechRecognition ||
|
|
|
|
window.oSpeechRecognition ||
|
|
|
|
window.msSpeechRecognition;
|
2015-06-02 01:46:06 -04:00
|
|
|
},
|
|
|
|
|
2016-02-23 12:57:38 -05:00
|
|
|
startListening: function () {
|
|
|
|
require(['voice/voicedialog'], function (voicedialog) {
|
|
|
|
voicedialog.startListening();
|
|
|
|
});
|
|
|
|
}
|
2015-06-02 01:46:06 -04:00
|
|
|
};
|
|
|
|
|
2016-01-30 14:31:22 -05:00
|
|
|
});
|