[mirotalksfu] - improve check speech recognition
هذا الالتزام موجود في:
@@ -6,6 +6,8 @@ let isVoiceCommandsEnabled = true;
|
|||||||
let browserLanguage = navigator.language || navigator.userLanguage;
|
let browserLanguage = navigator.language || navigator.userLanguage;
|
||||||
let isVoiceCommandSupported = browserLanguage.includes('en-');
|
let isVoiceCommandSupported = browserLanguage.includes('en-');
|
||||||
|
|
||||||
|
const speechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||||
|
|
||||||
const commands = {
|
const commands = {
|
||||||
shareRoom: 'room',
|
shareRoom: 'room',
|
||||||
leaveRoom: 'exit the room',
|
leaveRoom: 'exit the room',
|
||||||
@@ -45,8 +47,8 @@ const commands = {
|
|||||||
stopRecognition: 'stop the voice recognition',
|
stopRecognition: 'stop the voice recognition',
|
||||||
};
|
};
|
||||||
|
|
||||||
if ('webkitSpeechRecognition' in window) {
|
if (speechRecognition) {
|
||||||
recognition = new webkitSpeechRecognition();
|
recognition = new speechRecognition();
|
||||||
|
|
||||||
recognition.maxAlternatives = 1;
|
recognition.maxAlternatives = 1;
|
||||||
recognition.continuous = true;
|
recognition.continuous = true;
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم