jellyfin-web/dashboard-ui/voice/voice.js

28 lines
780 B
JavaScript
Raw Normal View History

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