Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

refactor(web-hid): remove the WebHID integration

Jaya Allamsetty012104b8fb76
diff --git a/config.js b/config.js
index ee8ab750ad..16a7881285 100644
--- a/config.js
+++ b/config.js
@@ -759,9 +759,6 @@ var config = {
// Require users to always specify a display name.
// requireDisplayName: true,
- // Enables webhid functionality for Audio.
- // enableWebHIDFeature: false,
-
// DEPRECATED! Use 'welcomePage.disabled' instead.
// Whether to use a welcome page or not. In case it's false a random room
// will be joined when no room is specified.
diff --git a/lang/main-bg.json b/lang/main-bg.json
index d7ded7777c..44fad9f62b 100644
--- a/lang/main-bg.json
+++ b/lang/main-bg.json
@@ -250,12 +250,6 @@
"microphonePermission": "Грешка при получаване на разрешение за достъп до микрофона"
},
"deviceSelection": {
- "hid": {
- "callControl": "Управление на повикванията",
- "connectedDevices": "Свързани устройства:",
- "deleteDevice": "Изтрий устройство",
- "pairDevice": "Сдвояване на устройство"
- },
"noPermission": "Не е получено разрешение",
"previewUnavailable": "Няма възможност за преглед",
"selectADevice": "Изберете устройство",
diff --git a/lang/main-ca.json b/lang/main-ca.json
index 9569a97b7d..f403f23609 100644
--- a/lang/main-ca.json
+++ b/lang/main-ca.json
@@ -305,12 +305,6 @@
"microphonePermission": "S'ha produït un error en obtenir el permís del micròfon"
},
"deviceSelection": {
- "hid": {
- "callControl": "Control de trucades",
- "connectedDevices": "Dispositius connectats:",
- "deleteDevice": "Suprimeix el dispositiu",
- "pairDevice": "Enllaça el dispositiu"
- },
"noPermission": "No s'ha concedit el permís",
"previewUnavailable": "La previsualització no és disponible",
"selectADevice": "Seleccioneu un aparell",
diff --git a/lang/main-cs.json b/lang/main-cs.json
index 2df8b4d4f5..d52eeff090 100644
--- a/lang/main-cs.json
+++ b/lang/main-cs.json
@@ -235,12 +235,6 @@
"microphonePermission": "Aplikace nemá oprávnění přistupovat k mikrofonu"
},
"deviceSelection": {
- "hid": {
- "callControl": "Ovládání hovorů",
- "connectedDevices": "Připojená zařízení:",
- "deleteDevice": "Smazat zařízení",
- "pairDevice": "Spárovat zařízení"
- },
"noPermission": "Oprávnění není uděleno",
"previewUnavailable": "Náhled není dostupný",
"selectADevice": "Zvolte zařízení",
diff --git a/lang/main-da.json b/lang/main-da.json
index f606e2e518..969075f471 100644
--- a/lang/main-da.json
+++ b/lang/main-da.json
@@ -261,12 +261,6 @@
"microphonePermission": "Fejl ved at få tilladelse til bruge din mikrofon"
},
"deviceSelection": {
- "hid": {
- "callControl": "Opkaldskontrol",
- "connectedDevices": "Tilsluttede enheder:",
- "deleteDevice": "Slet enhed",
- "pairDevice": "Par enhed"
- },
"noPermission": "Tilladelse ikke givet",
"previewUnavailable": "Forhåndsvisning ikke tilgængelig",
"selectADevice": "Vælg en enhed",
diff --git a/lang/main-de.json b/lang/main-de.json
index 0c0f891d9b..eb67744278 100644
--- a/lang/main-de.json
+++ b/lang/main-de.json
@@ -273,12 +273,6 @@
"microphonePermission": "Mikrofon-Zugriffsberechtigungen konnten nicht abgerufen werden"
},
"deviceSelection": {
- "hid": {
- "callControl": "Anrufsteuerung",
- "connectedDevices": "Verbundene Geräte:",
- "deleteDevice": "Gerät löschen",
- "pairDevice": "Gerät verbinden"
- },
"noPermission": "Berechtigungen nicht erteilt",
"previewUnavailable": "Keine Vorschau verfügbar",
"selectADevice": "Ein Gerät wählen",
diff --git a/lang/main-el.json b/lang/main-el.json
index e83f5487b3..df471d920b 100644
--- a/lang/main-el.json
+++ b/lang/main-el.json
@@ -208,12 +208,6 @@
"microphonePermission": "Σφάλμα κατά τη λήψη άδειας για χρήση του μικρόφωνου"
},
"deviceSelection": {
- "hid": {
- "callControl": "Έλεγχος κλήσης",
- "connectedDevices": "Συνδεδεμένες συσκευές:",
- "deleteDevice": "Αφαίρεση συσκευής",
- "pairDevice": "Ζεύγος με συσκευή"
- },
"noPermission": "Δεν χορηγήθηκε άδεια",
"previewUnavailable": "Μη διαθέσιμη προεπισκόπηση",
"selectADevice": "Επιλέξτε μια συσκευή",
diff --git a/lang/main-eo.json b/lang/main-eo.json
index 90b0fee628..10490f7457 100644
--- a/lang/main-eo.json
+++ b/lang/main-eo.json
@@ -232,12 +232,6 @@
"microphonePermission": "Eraro akirante permeson por mikrofono"
},
"deviceSelection": {
- "hid": {
- "callControl": "Voko kontrolo",
- "connectedDevices": "Ligitaj aparatoj:",
- "deleteDevice": "Forgesu aparaton",
- "pairDevice": "Kuplu aparaton"
- },
"noPermission": "Permeso ne estis donita",
"previewUnavailable": "Antaŭrigardo ne disponeblas",
"selectADevice": "Elektu aparaton",
diff --git a/lang/main-es.json b/lang/main-es.json
index f64edde5ce..a72a25c9c5 100644
--- a/lang/main-es.json
+++ b/lang/main-es.json
@@ -305,12 +305,6 @@
"microphonePermission": "Error al obtener permiso del micrófono"
},
"deviceSelection": {
- "hid": {
- "callControl": "Control de llamadas",
- "connectedDevices": "Dispositivos conectados:",
- "deleteDevice": "Eliminar dispositivo",
- "pairDevice": "Emparejar dispositivo"
- },
"noPermission": "Permiso no concedido",
"previewUnavailable": "Vista previa no disponible",
"selectADevice": "Seleccionar un dispositivo",
diff --git a/lang/main-fa.json b/lang/main-fa.json
index 1a913bf83d..75d118a25e 100644
--- a/lang/main-fa.json
+++ b/lang/main-fa.json
@@ -303,12 +303,6 @@
"microphonePermission": "خطا در گرفتن اجازهٔ میکروفن"
},
"deviceSelection": {
- "hid": {
- "callControl": "کنترل تماس",
- "connectedDevices": "دستگاه‌های متصل:",
- "deleteDevice": "حذف دستگاه",
- "pairDevice": "جفت‌کردن دستگاه"
- },
"noPermission": "دسترسی رد شد",
"previewUnavailable": "پیش‌نمایش در دسترس نیست",
"selectADevice": "یک دستگاه را انتخاب کنید",
diff --git a/lang/main-fi.json b/lang/main-fi.json
index 0cc8f4ce95..79087220af 100644
--- a/lang/main-fi.json
+++ b/lang/main-fi.json
@@ -264,12 +264,6 @@
"microphonePermission": "Virhe mikrofonin käyttöoikeuksien hankkimisessa"
},
"deviceSelection": {
- "hid": {
- "callControl": "Puhelun hallinta",
- "connectedDevices": "Yhdistetyt laitteet:",
- "deleteDevice": "Poista laite",
- "pairDevice": "Yhdistä laite"
- },
"noPermission": "Käyttöoikeuksia ei myönnetty",
"previewUnavailable": "Esikatselu ei käytettävissä",
"selectADevice": "Valitse laite",
diff --git a/lang/main-fr-CA.json b/lang/main-fr-CA.json
index fc3ef7892a..7949b8e65a 100644
--- a/lang/main-fr-CA.json
+++ b/lang/main-fr-CA.json
@@ -250,12 +250,6 @@
"microphonePermission": "Erreur lors de l'obtention de l'autorisation du micro"
},
"deviceSelection": {
- "hid": {
- "callControl": "Contrôle des appels",
- "connectedDevices": "Appareils connectés",
- "deleteDevice": "Supprimer un appareil",
- "pairDevice": "Connecter un appareil"
- },
"noPermission": "L'autorisation n'a pas été accordée",
"previewUnavailable": "Prévisualisation non disponible",
"selectADevice": "Sélectionner un dispositif",
diff --git a/lang/main-fr.json b/lang/main-fr.json
index 71b8ecce40..b5fd38cf00 100644
--- a/lang/main-fr.json
+++ b/lang/main-fr.json
@@ -264,12 +264,6 @@
"microphonePermission": "Erreur lors de l'obtention de la permission du microphone"
},
"deviceSelection": {
- "hid": {
- "callControl": "Contrôle des appels",
- "connectedDevices": "Appareils connectés",
- "deleteDevice": "Supprimer un appareil",
- "pairDevice": "Connecter un appareil"
- },
"noPermission": "Permission non accordée",
"previewUnavailable": "Aperçu non disponible",
"selectADevice": "Sélectionner un périphérique",
diff --git a/lang/main-hi.json b/lang/main-hi.json
index 0634a24dcb..67d2b4de3a 100644
--- a/lang/main-hi.json
+++ b/lang/main-hi.json
@@ -273,12 +273,6 @@
"microphonePermission": "माइक्रोफ़ोन अनुमति प्राप्त करने में त्रुटि"
},
"deviceSelection": {
- "hid": {
- "callControl": "कॉल नियंत्रण",
- "connectedDevices": "कनेक्टेड डिवाइस:",
- "deleteDevice": "डिवाइस हटाएँ",
- "pairDevice": "डिवाइस जोड़ें"
- },
"noPermission": "अनुमति नहीं दी गई",
"previewUnavailable": "पूर्वदर्शन अनुपलब्ध",
"selectADevice": "डिवाइस का चयन करें",
diff --git a/lang/main-id.json b/lang/main-id.json
index 54b0c911f9..1599b61cbc 100644
--- a/lang/main-id.json
+++ b/lang/main-id.json
@@ -235,12 +235,6 @@
"microphonePermission": "Error memperoleh izin mikrofon"
},
"deviceSelection": {
- "hid": {
- "callControl": "Kontrol panggilan",
- "connectedDevices": "Perangkat terhubung:",
- "deleteDevice": "Hapus perangkat",
- "pairDevice": "Pasangkan perangkat"
- },
"noPermission": "Izin tidak diberikan",
"previewUnavailable": "Pratinjau tidak tersedia",
"selectADevice": "Pilih perangkat",
diff --git a/lang/main-is.json b/lang/main-is.json
index 08685d06ac..1ee45ebb36 100644
--- a/lang/main-is.json
+++ b/lang/main-is.json
@@ -232,12 +232,6 @@
"microphonePermission": "Villa við að fá heimild fyrir hljóðnema"
},
"deviceSelection": {
- "hid": {
- "callControl": "Stýring símtala",
- "connectedDevices": "Tengd tæki:",
- "deleteDevice": "Eyða tæki",
- "pairDevice": "Para tæki"
- },
"noPermission": "Heimild ekki veitt",
"previewUnavailable": "Forskoðun ekki tiltæk",
"selectADevice": "Veldu tæki",
diff --git a/lang/main-it.json b/lang/main-it.json
index dcff6c2a43..c9c3aca3d3 100644
--- a/lang/main-it.json
+++ b/lang/main-it.json
@@ -264,12 +264,6 @@
"microphonePermission": "Errore nell'acquisizione dei permessi del microfono"
},
"deviceSelection": {
- "hid": {
- "callControl": "Controllo chiamata",
- "connectedDevices": "Dispositivi connessi:",
- "deleteDevice": "Elimina dispositivo",
- "pairDevice": "Accoppia dispositivo"
- },
"noPermission": "Permesso negato",
"previewUnavailable": "Anteprima non disponibile",
"selectADevice": "Scegli un dispositivo",
diff --git a/lang/main-kk.json b/lang/main-kk.json
index 822a664a35..28807a20a9 100644
--- a/lang/main-kk.json
+++ b/lang/main-kk.json
@@ -261,12 +261,6 @@
"microphonePermission": "Микрофон рұқсатын алу қатесі"
},
"deviceSelection": {
- "hid": {
- "callControl": "Қоңырауды басқару",
- "connectedDevices": "Қосылған құрылғылар:",
- "deleteDevice": "Құрылғыны жою",
- "pairDevice": "Құрылғыны жұптау"
- },
"noPermission": "Рұқсат берілмеген",
"previewUnavailable": "Алдын ала қарау қолжетімсіз",
"selectADevice": "Құрылғыны таңдаңыз",
diff --git a/lang/main-ko.json b/lang/main-ko.json
index e0864ea013..8e0e59648a 100644
--- a/lang/main-ko.json
+++ b/lang/main-ko.json
@@ -235,12 +235,6 @@
"microphonePermission": "마이크 권한을 얻는 중 오류가 발생했습니다"
},
"deviceSelection": {
- "hid": {
- "callControl": "통화 제어",
- "connectedDevices": "연결된 장치:",
- "deleteDevice": "장치 삭제",
- "pairDevice": "장치 연결"
- },
"noPermission": "허가 거부",
"previewUnavailable": "미리보기를 사용할 수 없음",
"selectADevice": "장치 선택",
diff --git a/lang/main-lv.json b/lang/main-lv.json
index 52a5c3c11f..584aa4e3af 100644
--- a/lang/main-lv.json
+++ b/lang/main-lv.json
@@ -297,12 +297,6 @@
"microphonePermission": "Iegūstot mikrofona atļauju, radās kļūdas"
},
"deviceSelection": {
- "hid": {
- "callControl": "Zvanu kontrole",
- "connectedDevices": "Pieslēgtās ierīces:",
- "deleteDevice": "Dzēst ierīci",
- "pairDevice": "Savienot ierīci pārī"
- },
"noPermission": "Atļauja nav piešķirta",
"previewUnavailable": "Priekšskats nav pieejams",
"selectADevice": "Ierīces izvēle",
diff --git a/lang/main-mn.json b/lang/main-mn.json
index 86c579616d..0493046953 100644
--- a/lang/main-mn.json
+++ b/lang/main-mn.json
@@ -264,12 +264,6 @@
"microphonePermission": "Микрофоны зөвшөөрөл авахад алдаа гарлаа"
},
"deviceSelection": {
- "hid": {
- "callControl": "Дуудлага хянах",
- "connectedDevices": "Холбогдсон төхөөрөмжүүд:",
- "deleteDevice": "Төхөөрөмж устгах",
- "pairDevice": "Төхөөрөмж холбох"
- },
"noPermission": "Зөвшөөрөл өгөөгүй байна",
"previewUnavailable": "Урьдчилан харах боломжгүй",
"selectADevice": "Төхөөрөмж сонгоно уу",
diff --git a/lang/main-nb.json b/lang/main-nb.json
index 52027362ac..23d77658e9 100644
--- a/lang/main-nb.json
+++ b/lang/main-nb.json
@@ -235,12 +235,6 @@
"microphonePermission": "Feil ved innhenting av mikrofontillatelse"
},
"deviceSelection": {
- "hid": {
- "callControl": "Samtalekontroll",
- "connectedDevices": "Tilkoblede enheter:",
- "deleteDevice": "Slett enhet",
- "pairDevice": "Koble til enhet"
- },
"noPermission": "Tillatelse ikke gitt",
"previewUnavailable": "Forhåndsvisning ikke tilgjengelig",
"selectADevice": "Velg en enhet",
diff --git a/lang/main-nl.json b/lang/main-nl.json
index 00424e3daa..04eba5b4b7 100644
--- a/lang/main-nl.json
+++ b/lang/main-nl.json
@@ -305,12 +305,6 @@
"microphonePermission": "Fout bij verkrijgen toegangsrecht microfoon"
},
"deviceSelection": {
- "hid": {
- "callControl": "Gesprekscontrole",
- "connectedDevices": "Verbonden apparaten:",
- "deleteDevice": "Apparaat verwijderen",
- "pairDevice": "Apparaat koppelen"
- },
"noPermission": "Geen toestemming verleend",
"previewUnavailable": "Voorbeeld niet beschikbaar",
"selectADevice": "Selecteer een apparaat",
diff --git a/lang/main-no.json b/lang/main-no.json
index 52027362ac..23d77658e9 100644
--- a/lang/main-no.json
+++ b/lang/main-no.json
@@ -235,12 +235,6 @@
"microphonePermission": "Feil ved innhenting av mikrofontillatelse"
},
"deviceSelection": {
- "hid": {
- "callControl": "Samtalekontroll",
- "connectedDevices": "Tilkoblede enheter:",
- "deleteDevice": "Slett enhet",
- "pairDevice": "Koble til enhet"
- },
"noPermission": "Tillatelse ikke gitt",
"previewUnavailable": "Forhåndsvisning ikke tilgjengelig",
"selectADevice": "Velg en enhet",
diff --git a/lang/main-oc.json b/lang/main-oc.json
index 4192bc501f..b6aa34d9b5 100644
--- a/lang/main-oc.json
+++ b/lang/main-oc.json
@@ -235,12 +235,6 @@
"microphonePermission": "Error d'obtencion de la permission pel microfòn"
},
"deviceSelection": {
- "hid": {
- "callControl": "Contraròtle de las sonadas",
- "connectedDevices": "Aparelhs connectats :",
- "deleteDevice": "Suprimir lo periferic",
- "pairDevice": "Associar un aparelh"
- },
"noPermission": "Autorizacion pas acordada",
"previewUnavailable": "Apercebut pas disponible",
"selectADevice": "Seleccionatz un aparelh",
diff --git a/lang/main-pl.json b/lang/main-pl.json
index 0fe4a06664..2c60933d5d 100644
--- a/lang/main-pl.json
+++ b/lang/main-pl.json
@@ -210,12 +210,6 @@
"microphonePermission": "Błąd podczas otrzymywania uprawnień do mikrofonu"
},
"deviceSelection": {
- "hid": {
- "callControl": "Kontrola połączeń",
- "connectedDevices": "Połączone urządzenia:",
- "deleteDevice": "Usuń urządzenie",
- "pairDevice": "Sparuj urządzenie"
- },
"noPermission": "Nie przyznano uprawnienia",
"previewUnavailable": "Podgląd niedostępny",
"selectADevice": "Wybierz urządzenie",
diff --git a/lang/main-pt-BR.json b/lang/main-pt-BR.json
index fb85a45b2f..a11811fca6 100644
--- a/lang/main-pt-BR.json
+++ b/lang/main-pt-BR.json
@@ -232,12 +232,6 @@
"microphonePermission": "Erro ao obter permissão para o microfone"
},
"deviceSelection": {
- "hid": {
- "callControl": "Controle de chamada",
- "connectedDevices": "Dispositivos conectados:",
- "deleteDevice": "Remover dispositivo",
- "pairDevice": "Emparelhar dispositivo"
- },
"noPermission": "Permissão não concedida",
"previewUnavailable": "Visualização indisponível",
"selectADevice": "Selecione um dispositivo",
diff --git a/lang/main-pt.json b/lang/main-pt.json
index 86622ed046..6be33c3e15 100644
--- a/lang/main-pt.json
+++ b/lang/main-pt.json
@@ -273,12 +273,6 @@
"microphonePermission": "Erro ao obter permissão para o microfone"
},
"deviceSelection": {
- "hid": {
- "callControl": "Controlo de chamadas",
- "connectedDevices": "Dispositivos ligados:",
- "deleteDevice": "Apagar dispositivo",
- "pairDevice": "Emparelhar dispositivo"
- },
"noPermission": "Permissão não concedida",
"previewUnavailable": "Visualização indisponível",
"selectADevice": "Selecione um dispositivo",
diff --git a/lang/main-ru.json b/lang/main-ru.json
index 631cadbcf5..4b773d745f 100644
--- a/lang/main-ru.json
+++ b/lang/main-ru.json
@@ -234,12 +234,6 @@
"microphonePermission": "Нет разрешения на доступ к микрофону"
},
"deviceSelection": {
- "hid": {
- "callControl": "Управление вызовами",
- "connectedDevices": "Подключенные устройства:",
- "deleteDevice": "Удалить устройство",
- "pairDevice": "Сопряжение устройства"
- },
"noPermission": "Нет доступа",
"previewUnavailable": "Предпросмотр недоступен",
"selectADevice": "Выбор устройства",
diff --git a/lang/main-sc.json b/lang/main-sc.json
index 811ee4900d..d41de05270 100644
--- a/lang/main-sc.json
+++ b/lang/main-sc.json
@@ -250,12 +250,6 @@
"microphonePermission": "Faddina in is permissos pro su micròfonu"
},
"deviceSelection": {
- "hid": {
- "callControl": "Controllu de mutidas",
- "connectedDevices": "Dispositivos connètidos:",
- "deleteDevice": "Cantzella su dispositivu",
- "pairDevice": "Assòtzia unu dispositivu"
- },
"noPermission": "No as cuntzèdidu permissos",
"previewUnavailable": "Sa pre-visualizatzione no est a disponimentu",
"selectADevice": "Sèbera unu dispositivu",
diff --git a/lang/main-sq.json b/lang/main-sq.json
index a0560010a1..263d13d7c8 100644
--- a/lang/main-sq.json
+++ b/lang/main-sq.json
@@ -264,12 +264,6 @@
"microphonePermission": "Gabim në marrje lejesh mbi mikrofonin"
},
"deviceSelection": {
- "hid": {
- "callControl": "Kontroll thirrjesh",
- "connectedDevices": "Pajisje të lidhura:",
- "deleteDevice": "Fshije pajisjen",
- "pairDevice": "Çiftoni pajisje"
- },
"noPermission": "S’u akordua leje",
"previewUnavailable": "S’bëhet dot paraparje",
"selectADevice": "Përzgjidhni një pajisje",
diff --git a/lang/main-sv.json b/lang/main-sv.json
index 6badd96a5e..7f0bd48c09 100644
--- a/lang/main-sv.json
+++ b/lang/main-sv.json
@@ -264,12 +264,6 @@
"microphonePermission": "Fel vid begäran om åtkomst till mikrofon"
},
"deviceSelection": {
- "hid": {
- "callControl": "Samtalskontroll",
- "connectedDevices": "Anslutna enheter",
- "deleteDevice": "Radera enhet",
- "pairDevice": "Para enhet"
- },
"noPermission": "Behörighet nekad",
"previewUnavailable": "Förhandsgranskning inte tillgänglig",
"selectADevice": "Välj en enhet",
diff --git a/lang/main-tr.json b/lang/main-tr.json
index aae860613e..0d9315feb5 100644
--- a/lang/main-tr.json
+++ b/lang/main-tr.json
@@ -235,12 +235,6 @@
"microphonePermission": "Mikrofon erişim izni alınamadı"
},
"deviceSelection": {
- "hid": {
- "callControl": "Çağrı kontrolü",
- "connectedDevices": "Bağlı cihazlar:",
- "deleteDevice": "Cihazı sil",
- "pairDevice": "Cihazı eşleştir"
- },
"noPermission": "İzin alınamadı",
"previewUnavailable": "Önizleme mevcut değil",
"selectADevice": "Bir cihaz seç",
diff --git a/lang/main-uk.json b/lang/main-uk.json
index 079c99ab03..9dbe219161 100644
--- a/lang/main-uk.json
+++ b/lang/main-uk.json
@@ -208,12 +208,6 @@
"microphonePermission": "Помилка отримання дозволу доступу до мікрофона"
},
"deviceSelection": {
- "hid": {
- "callControl": "Налаштування зв'язку",
- "connectedDevices": "Приєднані пристрої:",
- "deleteDevice": "Вилучити пристрій",
- "pairDevice": "Додати пристрій Bluetooth"
- },
"noPermission": "Дозвіл не надано",
"previewUnavailable": "Перегляд недоступний",
"selectADevice": "Виберіть пристрій",
diff --git a/lang/main-vi.json b/lang/main-vi.json
index 29c9b17512..3a15d49602 100644
--- a/lang/main-vi.json
+++ b/lang/main-vi.json
@@ -234,12 +234,6 @@
"microphonePermission": "Lỗi cấp quyền micro"
},
"deviceSelection": {
- "hid": {
- "callControl": "Kiểm soát cuộc gọi",
- "connectedDevices": "Các thiết bị đã được kết nối:",
- "deleteDevice": "Xoá thiết bị",
- "pairDevice": "Ghép nối thiết bị"
- },
"noPermission": "Không được cấp quyền",
"previewUnavailable": "Xem trước không khả dụng",
"selectADevice": "Chọn một thiết bị",
diff --git a/lang/main-zh-CN.json b/lang/main-zh-CN.json
index 97a558d250..dd04d4dec9 100644
--- a/lang/main-zh-CN.json
+++ b/lang/main-zh-CN.json
@@ -253,12 +253,6 @@
"microphonePermission": "获取麦克风权限时出错"
},
"deviceSelection": {
- "hid": {
- "callControl": "呼叫控制",
- "connectedDevices": "已连接的设备:",
- "deleteDevice": "删除设备",
- "pairDevice": "配对设备"
- },
"noPermission": "未获得授权",
"previewUnavailable": "无法预览",
"selectADevice": "选择设备",
diff --git a/lang/main-zh-TW.json b/lang/main-zh-TW.json
index 904880e14c..08bad51fe3 100644
--- a/lang/main-zh-TW.json
+++ b/lang/main-zh-TW.json
@@ -253,12 +253,6 @@
"microphonePermission": "取得麥克風權限時發生錯誤"
},
"deviceSelection": {
- "hid": {
- "callControl": "通話控制",
- "connectedDevices": "已連線的裝置:",
- "deleteDevice": "刪除裝置",
- "pairDevice": "配對裝置"
- },
"noPermission": "未取得權限",
"previewUnavailable": "無法預覽",
"selectADevice": "選擇裝置",
diff --git a/lang/main.json b/lang/main.json
index 9dff62b3d9..93e73b805a 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -305,12 +305,6 @@
"microphonePermission": "Error obtaining microphone permission"
},
"deviceSelection": {
- "hid": {
- "callControl": "Call control",
- "connectedDevices": "Connected devices:",
- "deleteDevice": "Delete device",
- "pairDevice": "Pair device"
- },
"noPermission": "Permission not granted",
"previewUnavailable": "Preview unavailable",
"selectADevice": "Select a device",
diff --git a/package-lock.json b/package-lock.json
index 17221f7643..858e938f07 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -161,7 +161,6 @@
"@types/unorm": "1.3.28",
"@types/uuid": "8.3.4",
"@types/w3c-image-capture": "1.0.6",
- "@types/w3c-web-hid": "1.0.3",
"@types/webscreens-window-placement": "0.1.3",
"@types/zxcvbn": "4.4.1",
"babel-loader": "9.1.0",
@@ -7281,12 +7280,6 @@
"@types/webrtc": "*"
}
},
- "node_modules/@types/w3c-web-hid": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/@types/w3c-web-hid/-/w3c-web-hid-1.0.3.tgz",
- "integrity": "sha512-eTQRkPd2JukZfS9+kRtrBAaTCCb6waGh5X8BJHmH1MiVQPLMYwm4+EvhwFfOo9SDna15o9dFAwmWwN6r/YM53A==",
- "dev": true
- },
"node_modules/@types/webrtc": {
"version": "0.0.32",
"resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.32.tgz",
@@ -26793,12 +26786,6 @@
"@types/webrtc": "*"
}
},
- "@types/w3c-web-hid": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/@types/w3c-web-hid/-/w3c-web-hid-1.0.3.tgz",
- "integrity": "sha512-eTQRkPd2JukZfS9+kRtrBAaTCCb6waGh5X8BJHmH1MiVQPLMYwm4+EvhwFfOo9SDna15o9dFAwmWwN6r/YM53A==",
- "dev": true
- },
"@types/webrtc": {
"version": "0.0.32",
"resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.32.tgz",
diff --git a/package.json b/package.json
index 1dac33f9f4..fb42c5d6d6 100644
--- a/package.json
+++ b/package.json
@@ -167,7 +167,6 @@
"@types/unorm": "1.3.28",
"@types/uuid": "8.3.4",
"@types/w3c-image-capture": "1.0.6",
- "@types/w3c-web-hid": "1.0.3",
"@types/webscreens-window-placement": "0.1.3",
"@types/zxcvbn": "4.4.1",
"babel-loader": "9.1.0",
diff --git a/react/features/app/middlewares.web.ts b/react/features/app/middlewares.web.ts
index 19fd8db9fb..25fd46fa6c 100644
--- a/react/features/app/middlewares.web.ts
+++ b/react/features/app/middlewares.web.ts
@@ -20,7 +20,6 @@ import '../prejoin/middleware';
import '../remote-control/middleware';
import '../screen-share/middleware';
import '../shared-video/middleware';
-import '../web-hid/middleware';
import '../settings/middleware';
import '../talk-while-muted/middleware';
import '../toolbox/middleware';
diff --git a/react/features/app/reducers.web.ts b/react/features/app/reducers.web.ts
index a9003f9b6c..4bf7d3365c 100644
--- a/react/features/app/reducers.web.ts
+++ b/react/features/app/reducers.web.ts
@@ -19,7 +19,6 @@ import '../screenshot-capture/reducer';
import '../talk-while-muted/reducer';
import '../time-timer/reducer';
import '../virtual-background/reducer';
-import '../web-hid/reducer';
import '../file-sharing/reducer';
import './reducers.any';
diff --git a/react/features/app/types.ts b/react/features/app/types.ts
index e95ffaf3a2..649c50235b 100644
--- a/react/features/app/types.ts
+++ b/react/features/app/types.ts
@@ -85,7 +85,6 @@ import { IVideoSipGW } from '../videosipgw/reducer';
import { IVirtualBackground } from '../virtual-background/reducer';
import { IVisitorsState } from '../visitors/reducer';
import { IVoiceAgentsState } from '../voice-agents/reducer';
-import { IWebHid } from '../web-hid/reducer';
import { IWhiteboardState } from '../whiteboard/reducer';
export interface IStore {
@@ -182,7 +181,6 @@ export interface IReduxState {
'features/virtual-background': IVirtualBackground;
'features/visitors': IVisitorsState;
'features/voice-agents': IVoiceAgentsState;
- 'features/web-hid': IWebHid;
'features/whiteboard': IWhiteboardState;
}
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index 374b8c0256..89853a4570 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -442,7 +442,6 @@ export interface IConfig {
enableSaveLogs?: boolean;
enableTalkWhileMuted?: boolean;
enableTcc?: boolean;
- enableWebHIDFeature?: boolean;
/**
* @deprecated Use `welcomePage.disabled` instead.
*/
diff --git a/react/features/base/config/functions.web.ts b/react/features/base/config/functions.web.ts
index 86fb4a5f2c..f1d9fab6b9 100644
--- a/react/features/base/config/functions.web.ts
+++ b/react/features/base/config/functions.web.ts
@@ -30,16 +30,6 @@ export function getReplaceParticipant(state: IReduxState): string | undefined {
return state['features/base/config'].replaceParticipant;
}
-/**
- * Returns the configuration value of web-hid feature.
- *
- * @param {Object} state - The state of the app.
- * @returns {boolean} True if web-hid feature should be enabled, otherwise false.
- */
-export function getWebHIDFeatureConfig(state: IReduxState): boolean {
- return state['features/base/config'].enableWebHIDFeature || false;
-}
-
/**
* Returns whether audio level measurement is enabled or not.
*
diff --git a/react/features/device-selection/components/AudioDevicesSelection.web.tsx b/react/features/device-selection/components/AudioDevicesSelection.web.tsx
index 2873b53e4f..4762340e94 100644
--- a/react/features/device-selection/components/AudioDevicesSelection.web.tsx
+++ b/react/features/device-selection/components/AudioDevicesSelection.web.tsx
@@ -22,7 +22,6 @@ import logger from '../logger';
import AudioInputPreview from './AudioInputPreview.web';
import AudioOutputPreview from './AudioOutputPreview.web';
-import DeviceHidContainer from './DeviceHidContainer.web';
import DeviceSelector from './DeviceSelector.web';
@@ -94,11 +93,6 @@ interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
hideAudioOutputSelect: boolean;
- /**
- * Whether or not the hid device container should display.
- */
- hideDeviceHIDContainer: boolean;
-
/**
* Whether to hide noise suppression checkbox or not.
*/
@@ -308,7 +302,6 @@ class AudioDevicesSelection extends AbstractDialogTab<IProps, {}> {
hasAudioPermission,
hideAudioInputPreview,
hideAudioOutputPreview,
- hideDeviceHIDContainer,
hideNoiseSuppression,
isAdvancedAudioSettingsConfigEnabled,
iAmVisitor,
@@ -397,9 +390,6 @@ class AudioDevicesSelection extends AbstractDialogTab<IProps, {}> {
className = { classes.outputButton }
deviceId = { selectedAudioOutputId } />}
</div>
-
- {!hideDeviceHIDContainer && !iAmVisitor
- && <DeviceHidContainer />}
</div>
);
}
diff --git a/react/features/device-selection/components/DeviceHidContainer.web.tsx b/react/features/device-selection/components/DeviceHidContainer.web.tsx
deleted file mode 100644
index ff1ac159ca..0000000000
--- a/react/features/device-selection/components/DeviceHidContainer.web.tsx
+++ /dev/null
@@ -1,107 +0,0 @@
-import React, { useCallback } from 'react';
-import { useTranslation } from 'react-i18next';
-import { useDispatch, useSelector } from 'react-redux';
-import { makeStyles } from 'tss-react/mui';
-
-import Icon from '../../base/icons/components/Icon';
-import { IconTrash } from '../../base/icons/svg';
-import Button from '../../base/ui/components/web/Button';
-import { BUTTON_TYPES } from '../../base/ui/constants.any';
-import { closeHidDevice, requestHidDevice } from '../../web-hid/actions';
-import { getDeviceInfo, shouldRequestHIDDevice } from '../../web-hid/functions';
-
-const useStyles = makeStyles()(theme => {
- return {
- callControlContainer: {
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'flex-start'
- },
-
- label: {
- ...theme.typography.bodyShortRegular,
- color: theme.palette.deviceSelectorText,
- marginBottom: theme.spacing(2)
- },
-
- deviceRow: {
- display: 'flex',
- justifyContent: 'space-between'
- },
-
- deleteDevice: {
- cursor: 'pointer',
- textAlign: 'center'
- },
-
- headerConnectedDevice: {
- fontWeight: 600
- },
-
- hidContainer: {
- '> span': {
- marginLeft: '16px'
- }
- }
- };
-});
-
-/**
- * Device hid container.
- *
- * @param {IProps} props - The props of the component.
- * @returns {ReactElement}
- */
-function DeviceHidContainer() {
- const { t } = useTranslation();
- const deviceInfo = useSelector(getDeviceInfo);
- const showRequestDeviceInfo = shouldRequestHIDDevice(deviceInfo);
- const { classes } = useStyles();
- const dispatch = useDispatch();
-
- const onRequestControl = useCallback(() => {
- dispatch(requestHidDevice());
- }, [ dispatch ]);
-
- const onDeleteHid = useCallback(() => {
- dispatch(closeHidDevice());
- }, [ dispatch ]);
-
- return (
- <div
- className = { classes.callControlContainer }
- key = 'callControl'>
- <label
- className = { classes.label }
- htmlFor = 'callControl'>
- {t('deviceSelection.hid.callControl')}
- </label>
- {showRequestDeviceInfo && (
- <Button
- accessibilityLabel = { t('deviceSelection.hid.pairDevice') }
- id = 'request-control-btn'
- key = 'request-control-btn'
- label = { t('deviceSelection.hid.pairDevice') }
- onClick = { onRequestControl }
- type = { BUTTON_TYPES.SECONDARY } />
- )}
- {!showRequestDeviceInfo && (
- <div className = { classes.hidContainer }>
- <p className = { classes.headerConnectedDevice }>{t('deviceSelection.hid.connectedDevices')}</p>
- <div className = { classes.deviceRow }>
- <span>{deviceInfo.device?.productName}</span>
- <Icon
- ariaLabel = { t('deviceSelection.hid.deleteDevice') }
- className = { classes.deleteDevice }
- onClick = { onDeleteHid }
- role = 'button'
- src = { IconTrash }
- tabIndex = { 0 } />
- </div>
- </div>
- )}
- </div>
- );
-}
-
-export default DeviceHidContainer;
diff --git a/react/features/device-selection/functions.web.ts b/react/features/device-selection/functions.web.ts
index 3c268c1a05..775bcb7352 100644
--- a/react/features/device-selection/functions.web.ts
+++ b/react/features/device-selection/functions.web.ts
@@ -1,6 +1,5 @@
import { IStore } from '../app/types';
import { IStateful } from '../base/app/types';
-import { getWebHIDFeatureConfig } from '../base/config/functions.web';
import {
addPendingDeviceRequest,
getAvailableDevices,
@@ -26,7 +25,6 @@ import { getLocalJitsiAudioTrackSettings } from '../base/tracks/functions.any';
import { isNoiseSuppressionEnabled } from '../noise-suppression/functions';
import { isPrejoinPageVisible } from '../prejoin/functions';
import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from '../settings/constants';
-import { isDeviceHidSupported } from '../web-hid/functions';
/**
* Returns the properties for the audio device selection dialog from Redux state.
@@ -48,7 +46,6 @@ export function getAudioDeviceSelectionDialogProps(stateful: IStateful, isDispla
const inputDeviceChangeSupported = JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('input');
const speakerChangeSupported = JitsiMeetJS.mediaDevices.isDeviceChangeAvailable('output');
const userSelectedMic = getUserSelectedMicDeviceId(state);
- const deviceHidSupported = isDeviceHidSupported() && getWebHIDFeatureConfig(state);
const noiseSuppressionEnabled = isNoiseSuppressionEnabled(state);
const hideNoiseSuppression = isPrejoinPageVisible(state) || isDisplayedOnWelcomePage;
const audioSettings = state['features/settings'].audioSettings ?? getLocalJitsiAudioTrackSettings(state);
@@ -80,7 +77,6 @@ export function getAudioDeviceSelectionDialogProps(stateful: IStateful, isDispla
hideAudioInputPreview: disableAudioInputChange || !JitsiMeetJS.isCollectingLocalStats() || disablePreviews,
hideAudioOutputPreview: !speakerChangeSupported || disablePreviews,
hideAudioOutputSelect: !speakerChangeSupported,
- hideDeviceHIDContainer: !deviceHidSupported,
hideNoiseSuppression,
noiseSuppressionEnabled,
selectedAudioInputId,
diff --git a/react/features/pip/reducer.ts b/react/features/pip/reducer.ts
index 90d29e8649..4c1b04ba0c 100644
--- a/react/features/pip/reducer.ts
+++ b/react/features/pip/reducer.ts
@@ -20,7 +20,7 @@ export interface IPipState {
* window open for the page regardless of who opened it. Kept in Redux so that every change
* to the reference is observable by React.
*
- * The ts-ignore mirrors web-hid's HIDDevice: the pip feature is excluded from the native
+ * The ts-ignore is needed because the pip feature is excluded from the native
* TypeScript config, which has no DOM lib defining Window, but this interface still reaches
* the native check through IReduxState. Types are erased at build time, so the suppression
* only affects the type check and nothing on native ever reads this field.
diff --git a/react/features/web-hid/actionTypes.ts b/react/features/web-hid/actionTypes.ts
deleted file mode 100644
index 7c1ef1f0c5..0000000000
--- a/react/features/web-hid/actionTypes.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Action type to INIT_DEVICE.
- */
-export const INIT_DEVICE = 'INIT_DEVICE';
-
-/**
- * Action type to CLOSE_HID_DEVICE.
- */
-export const CLOSE_HID_DEVICE = 'CLOSE_HID_DEVICE';
-
-/**
- * Action type to REQUEST_HID_DEVICE.
- */
-export const REQUEST_HID_DEVICE = 'REQUEST_HID_DEVICE';
-
-/**
- * Action type to UPDATE_DEVICE.
- */
-export const UPDATE_DEVICE = 'UPDATE_DEVICE';
-
diff --git a/react/features/web-hid/actions.ts b/react/features/web-hid/actions.ts
deleted file mode 100644
index 4b9b805f5b..0000000000
--- a/react/features/web-hid/actions.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { CLOSE_HID_DEVICE, INIT_DEVICE, REQUEST_HID_DEVICE, UPDATE_DEVICE } from './actionTypes';
-import { IDeviceInfo } from './types';
-
-/**
- * Action used to init device.
- *
- * @param {IDeviceInfo} deviceInfo - Telephony device information.
- * @returns {Object}
- */
-export function initDeviceInfo(deviceInfo: IDeviceInfo) {
- return {
- type: INIT_DEVICE,
- deviceInfo
- };
-}
-
-/**
- * Request hid device.
- *
- * @returns {Object}
- */
-export function closeHidDevice() {
- return {
- type: CLOSE_HID_DEVICE
- };
-}
-
-/**
- * Request hid device.
- *
- * @param {IDeviceInfo} deviceInfo - Telephony device information.
- * @returns {Object}
- */
-export function requestHidDevice() {
- return {
- type: REQUEST_HID_DEVICE
- };
-}
-
-/**
- * Action used to init device.
- *
- * @param {IDeviceInfo} deviceInfo - Telephony device information.
- * @returns {Object}
- */
-export function updateDeviceInfo(deviceInfo: IDeviceInfo) {
- return {
- type: UPDATE_DEVICE,
- updates: deviceInfo
- };
-}
diff --git a/react/features/web-hid/functions.ts b/react/features/web-hid/functions.ts
deleted file mode 100644
index 25bdaf3ac5..0000000000
--- a/react/features/web-hid/functions.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-import { IReduxState, IStore } from '../app/types';
-import { MEDIA_TYPE } from '../base/media/constants';
-import { muteLocal } from '../video-menu/actions.any';
-
-import { updateDeviceInfo } from './actions';
-import { ACTION_HOOK_TYPE_NAME, EVENT_TYPE, IDeviceInfo } from './types';
-import WebHidManager from './webhid-manager';
-
-/**
- * Attach web hid event listeners.
- *
- * @param {Function} initDeviceListener - Init hid device listener.
- * @param {Function} updateDeviceListener - Update hid device listener.
- * @returns {void}
- */
-export function attachHidEventListeners(
- initDeviceListener: EventListenerOrEventListenerObject,
- updateDeviceListener: EventListenerOrEventListenerObject
-) {
- const hidManager = getWebHidInstance();
-
- if (typeof initDeviceListener === 'function') {
- hidManager.addEventListener(EVENT_TYPE.INIT_DEVICE, initDeviceListener);
- }
- if (typeof updateDeviceListener === 'function') {
- hidManager.addEventListener(EVENT_TYPE.UPDATE_DEVICE, updateDeviceListener);
- }
-}
-
-/**
- * Returns instance of web hid manager.
- *
-* @returns {WebHidManager} - WebHidManager instance.
- */
-export function getWebHidInstance(): WebHidManager {
- const hidManager = WebHidManager.getInstance();
-
- return hidManager;
-}
-
-/**
- * Returns root conference state.
- *
- * @param {IReduxState} state - Global state.
- * @returns {Object} Conference state.
- */
-export const getWebHidState = (state: IReduxState) => state['features/web-hid'];
-
-/**
- * Returns true if hid is supported.
- *
- * @returns {boolean}
- */
-export function isDeviceHidSupported(): boolean {
- const hidManager = getWebHidInstance();
-
- return hidManager.isSupported();
-}
-
-/**
- * Returns device info from state.
- *
- * @param {IReduxState} state - Global state.
- * @returns {boolean}
- */
-export function getDeviceInfo(state: IReduxState): IDeviceInfo {
- const hidState = getWebHidState(state);
-
- return hidState.deviceInfo;
-}
-
-/**
- * Handles updating hid device.
- *
- * @param {Function} dispatch - Redux dispatch.
- * @param {Function} customEventData - Custom event data.
- * @returns {void}
- */
-export function handleUpdateHidDevice(
- dispatch: IStore['dispatch'],
- customEventData: CustomEvent<{ actionResult?: { eventName: string; }; deviceInfo: IDeviceInfo; }>
-) {
- dispatch(updateDeviceInfo(customEventData.detail.deviceInfo));
-
- if (customEventData.detail?.actionResult?.eventName === ACTION_HOOK_TYPE_NAME.MUTE_SWITCH_ON) {
- dispatch(muteLocal(true, MEDIA_TYPE.AUDIO));
- } else if (customEventData.detail?.actionResult?.eventName === ACTION_HOOK_TYPE_NAME.MUTE_SWITCH_OFF) {
- dispatch(muteLocal(false, MEDIA_TYPE.AUDIO));
- }
-}
-
-/**
- * Remove web hid event listeners.
- *
- * @param {Function} initDeviceListener - Init hid device listener.
- * @param {Function} updateDeviceListener - Update hid device listener.
- * @returns {void}
- */
-export function removeHidEventListeners(
- initDeviceListener: EventListenerOrEventListenerObject,
- updateDeviceListener: EventListenerOrEventListenerObject
-) {
- const hidManager = getWebHidInstance();
-
- if (typeof initDeviceListener === 'function') {
- hidManager.removeEventListener(EVENT_TYPE.INIT_DEVICE, initDeviceListener);
- }
- if (typeof updateDeviceListener === 'function') {
- hidManager.removeEventListener(EVENT_TYPE.UPDATE_DEVICE, updateDeviceListener);
- }
-}
-
-/**
- * Returns true if there is no device info provided.
- *
- * @param {IDeviceInfo} deviceInfo - Device info state.
- * @returns {boolean}
- */
-export function shouldRequestHIDDevice(deviceInfo: IDeviceInfo): boolean {
- return !deviceInfo?.device || Object.keys(deviceInfo).length === 0;
-}
diff --git a/react/features/web-hid/logger.ts b/react/features/web-hid/logger.ts
deleted file mode 100644
index 146a6ed823..0000000000
--- a/react/features/web-hid/logger.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { getLogger } from '../base/logging/functions';
-
-export default getLogger('app:web-hid');
diff --git a/react/features/web-hid/middleware.ts b/react/features/web-hid/middleware.ts
deleted file mode 100644
index 6e3f7613e5..0000000000
--- a/react/features/web-hid/middleware.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-import { IStore } from '../app/types';
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app/actionTypes';
-import { getWebHIDFeatureConfig } from '../base/config/functions.web';
-import { SET_AUDIO_MUTED } from '../base/media/actionTypes';
-import { isAudioMuted } from '../base/media/functions';
-import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
-
-import { CLOSE_HID_DEVICE, REQUEST_HID_DEVICE } from './actionTypes';
-import { initDeviceInfo } from './actions';
-import {
- attachHidEventListeners,
- getWebHidInstance,
- handleUpdateHidDevice,
- isDeviceHidSupported,
- removeHidEventListeners
-} from './functions';
-import logger from './logger';
-import { COMMANDS, IDeviceInfo } from './types';
-
-/**
- * A listener for initialising the webhid device.
- */
-let initDeviceListener: (e: any) => void;
-
-/**
- * A listener for updating the webhid device.
- */
-let updateDeviceListener: (e: any) => void;
-
-/**
- * The redux middleware for {@link WebHid}.
- *
- * @param {Store} store - The redux store.
- * @returns {Function}
- */
-MiddlewareRegistry.register((store: IStore) => next => action => {
- const { dispatch, getState } = store;
-
- if (!getWebHIDFeatureConfig(getState())) {
- return next(action);
- }
-
- switch (action.type) {
- case APP_WILL_MOUNT: {
- const hidManager = getWebHidInstance();
-
- if (!hidManager.isSupported()) {
- logger.warn('HID is not supported');
-
- break;
- }
-
- const _initDeviceListener = (e: CustomEvent<{ deviceInfo: IDeviceInfo; }>) =>
- dispatch(initDeviceInfo(e.detail.deviceInfo));
- const _updateDeviceListener
- = (e: CustomEvent<{ actionResult: { eventName: string; }; deviceInfo: IDeviceInfo; }>) =>
- handleUpdateHidDevice(dispatch, e);
-
-
- initDeviceListener = _initDeviceListener;
- updateDeviceListener = _updateDeviceListener;
-
- hidManager.listenToConnectedHid();
- attachHidEventListeners(initDeviceListener, updateDeviceListener);
-
- break;
- }
- case APP_WILL_UNMOUNT: {
- const hidManager = getWebHidInstance();
-
- if (!isDeviceHidSupported()) {
- break;
- }
-
- removeHidEventListeners(initDeviceListener, updateDeviceListener);
- hidManager.close();
-
- break;
- }
- case CLOSE_HID_DEVICE: {
- const hidManager = getWebHidInstance();
-
- // cleanup event handlers when hid device is removed from Settings.
- removeHidEventListeners(initDeviceListener, updateDeviceListener);
-
- hidManager.close();
-
- break;
- }
- case REQUEST_HID_DEVICE: {
- _onRequestHIDDevice(store);
-
- break;
- }
- case SET_AUDIO_MUTED: {
- const hidManager = getWebHidInstance();
-
- if (!isDeviceHidSupported()) {
- break;
- }
-
- hidManager.sendDeviceReport({ command: action.muted ? COMMANDS.MUTE_ON : COMMANDS.MUTE_OFF });
- break;
- }
- }
-
- return next(action);
-});
-
-/**
- * Handles HID device requests.
- *
- * @param {IStore} store - The redux store.
- * @returns {Promise}
- */
-async function _onRequestHIDDevice(store: IStore) {
- const { dispatch } = store;
- const hidManager = getWebHidInstance();
- const availableDevices = await hidManager.requestHidDevices();
-
- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
- if (!availableDevices || !availableDevices.length) {
- logger.info('HID device not available');
-
- return;
- }
-
- const _initDeviceListener = (e: CustomEvent<{ deviceInfo: IDeviceInfo; }>) =>
- dispatch(initDeviceInfo(e.detail.deviceInfo));
- const _updateDeviceListener
- = (e: CustomEvent<{ actionResult: { eventName: string; }; deviceInfo: IDeviceInfo; }>) => {
- handleUpdateHidDevice(dispatch, e);
- };
-
- initDeviceListener = _initDeviceListener;
- updateDeviceListener = _updateDeviceListener;
-
- attachHidEventListeners(initDeviceListener, updateDeviceListener);
- await hidManager.listenToConnectedHid();
-
- // sync headset to mute if participant is already muted.
- if (isAudioMuted(store.getState())) {
- hidManager.sendDeviceReport({ command: COMMANDS.MUTE_ON });
- }
-}
diff --git a/react/features/web-hid/reducer.ts b/react/features/web-hid/reducer.ts
deleted file mode 100644
index f1c994a230..0000000000
--- a/react/features/web-hid/reducer.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import ReducerRegistry from '../base/redux/ReducerRegistry';
-
-import { CLOSE_HID_DEVICE, INIT_DEVICE, UPDATE_DEVICE } from './actionTypes';
-import { IDeviceInfo } from './types';
-
-/**
- * The initial state of the web-hid feature.
-*/
-const DEFAULT_STATE = {
- deviceInfo: {} as IDeviceInfo
-};
-
-export interface IWebHid {
- deviceInfo: IDeviceInfo;
-}
-
-
-ReducerRegistry.register<IWebHid>(
-'features/web-hid',
-(state: IWebHid = DEFAULT_STATE, action): IWebHid => {
- switch (action.type) {
- case INIT_DEVICE:
- return {
- ...state,
- deviceInfo: action.deviceInfo
- };
- case UPDATE_DEVICE:
- return {
- ...state,
- deviceInfo: {
- ...state.deviceInfo,
- ...action.updates
- }
- };
- case CLOSE_HID_DEVICE:
- return {
- ...state,
- deviceInfo: DEFAULT_STATE.deviceInfo
- };
- default:
- return state;
- }
-});
diff --git a/react/features/web-hid/types.ts b/react/features/web-hid/types.ts
deleted file mode 100644
index 9b8c5b847c..0000000000
--- a/react/features/web-hid/types.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-export const EVENT_TYPE = {
- INIT_DEVICE: 'INIT_DEVICE',
- UPDATE_DEVICE: 'UPDATE_DEVICE'
-};
-
-export const HOOK_STATUS = {
- ON: 'on',
- OFF: 'off'
-};
-
-export const COMMANDS = {
- ON_HOOK: 'onHook',
- OFF_HOOK: 'offHook',
- MUTE_OFF: 'muteOff',
- MUTE_ON: 'muteOn',
- ON_RING: 'onRing',
- OFF_RING: 'offRing',
- ON_HOLD: 'onHold',
- OFF_HOLD: 'offHold'
-};
-
-export const INPUT_REPORT_EVENT_NAME = {
- ON_DEVICE_HOOK_SWITCH: 'ondevicehookswitch',
- ON_DEVICE_MUTE_SWITCH: 'ondevicemuteswitch'
-};
-
-export const ACTION_HOOK_TYPE_NAME = {
- HOOK_SWITCH_ON: 'HOOK_SWITCH_ON',
- HOOK_SWITCH_OFF: 'HOOK_SWITCH_OFF',
- MUTE_SWITCH_ON: 'MUTE_SWITCH_ON',
- MUTE_SWITCH_OFF: 'MUTE_SWITCH_OFF',
- VOLUME_CHANGE_UP: 'VOLUME_CHANGE_UP',
- VOLUME_CHANGE_DOWN: 'VOLUME_CHANGE_DOWN'
-};
-
-export interface IDeviceInfo {
-
- // @ts-ignore
- device: HIDDevice;
- hold: boolean;
- hookStatus: string;
- muted: boolean;
- ring: boolean;
-}
diff --git a/react/features/web-hid/utils.ts b/react/features/web-hid/utils.ts
deleted file mode 100644
index 18b044e89a..0000000000
--- a/react/features/web-hid/utils.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Telephony usage actions based on HID Usage tables for Universal Serial Bus (page 112.).
- *
- */
-export const TELEPHONY_DEVICE_USAGE_PAGE = 11;
-
-/** Telephony usages
- * - used to parse HIDDevice UsageId collections
- ** - outputReports has mute and offHook
- ** - inputReports exists hookSwitch and phoneMute.
- **/
-export const DEVICE_USAGE = {
- /* outputReports. */
- mute: {
- usageId: 0x080009,
- usageName: 'Mute'
- },
- offHook: {
- usageId: 0x080017,
- usageName: 'Off Hook'
- },
- ring: {
- usageId: 0x080018,
- usageName: 'Ring'
- },
- hold: {
- usageId: 0x080020,
- usageName: 'Hold'
- },
-
- /* inputReports. */
- hookSwitch: {
- usageId: 0x0b0020,
- usageName: 'Hook Switch'
- },
- phoneMute: {
- usageId: 0x0b002f,
- usageName: 'Phone Mute'
- }
-};
-
-/**
- * Filter with telephony devices based on HID Usage tables for Universal Serial Bus (page 17).
- *
- * @type {{ filters: { usagePage: string }; exclusionFilters: {}; }}
- */
-export const requestTelephonyHID = {
- filters: [ {
- usagePage: TELEPHONY_DEVICE_USAGE_PAGE
- } ],
- exclusionFilters: []
-};
diff --git a/react/features/web-hid/webhid-manager.ts b/react/features/web-hid/webhid-manager.ts
deleted file mode 100644
index 7344bebb61..0000000000
--- a/react/features/web-hid/webhid-manager.ts
+++ /dev/null
@@ -1,1018 +0,0 @@
-import logger from './logger';
-import {
- ACTION_HOOK_TYPE_NAME,
- COMMANDS,
- EVENT_TYPE,
- HOOK_STATUS,
- IDeviceInfo,
- INPUT_REPORT_EVENT_NAME
-} from './types';
-import {
- DEVICE_USAGE,
- TELEPHONY_DEVICE_USAGE_PAGE,
- requestTelephonyHID
-} from './utils';
-
-/**
- * WebHID manager that incorporates all hid specific logic.
- *
- * @class WebHidManager
- */
-export default class WebHidManager extends EventTarget {
- hidSupport: boolean;
- deviceInfo: IDeviceInfo;
- availableDevices: HIDDevice[];
- isParseDescriptorsSuccess: boolean;
- outputEventGenerators: { [key: string]: Function; };
- deviceCommand = {
- outputReport: {
- mute: {
- reportId: 0,
- usageOffset: -1
- },
- offHook: {
- reportId: 0,
- usageOffset: -1
- },
- ring: {
- reportId: 0,
- usageOffset: 0
- },
- hold: {
- reportId: 0,
- usageOffset: 0
- }
- },
- inputReport: {
- hookSwitch: {
- reportId: 0,
- usageOffset: -1,
- isAbsolute: false
- },
- phoneMute: {
- reportId: 0,
- usageOffset: -1,
- isAbsolute: false
- }
- }
- };
-
- private static instance: WebHidManager;
-
- /**
- * WebHidManager getInstance.
- *
- * @static
- * @returns {WebHidManager} - WebHidManager instance.
- */
- static getInstance(): WebHidManager {
- if (!this.instance) {
- this.instance = new WebHidManager();
- }
-
- return this.instance;
- }
-
- /**
- * Creates an instance of WebHidManager.
- *
- */
- constructor() {
- super();
-
- this.deviceInfo = {} as IDeviceInfo;
- this.hidSupport = this.isSupported();
- this.availableDevices = [];
- this.isParseDescriptorsSuccess = false;
- this.outputEventGenerators = {};
- }
-
- /**
- * Check support of hid in navigator.
- * - experimental API in Chrome.
- *
- * @returns {boolean} - True if supported, otherwise false.
- */
- isSupported(): boolean {
- // @ts-ignore
- return Boolean(window.navigator.hid?.requestDevice);
- }
-
- /**
- * Handler for requesting telephony hid devices.
- *
- * @returns {HIDDevice[]|null}
- */
- async requestHidDevices() {
- if (!this.hidSupport) {
- logger.warn('The WebHID API is NOT supported!');
-
- return null;
- }
-
- if (this.deviceInfo?.device?.opened) {
- await this.close();
- }
-
- // @ts-ignore
- const devices = await navigator.hid.requestDevice(requestTelephonyHID);
-
- if (!devices?.length) {
- logger.warn('No HID devices selected.');
-
- return false;
- }
-
- this.availableDevices = devices;
-
- return devices;
- }
-
- /**
- * Handler for listen to already connected hid.
- *
- * @returns {void}
- */
- async listenToConnectedHid() {
- const devices = await this.loadPairedDevices();
-
- if (!devices?.length) {
- logger.warn('No hid device found.');
-
- return;
- }
-
- const telephonyDevice = this.getTelephonyDevice(devices);
-
- if (!telephonyDevice) {
- logger.warn('No HID device to request');
-
- return;
- }
-
- await this.open(telephonyDevice);
-
- // restore the default state of hook and mic LED
- this.resetDeviceState();
-
- // switch headsets to OFF_HOOK for mute/unmute commands
- this.sendDeviceReport({ command: COMMANDS.OFF_HOOK });
- }
-
- /**
- * Get first telephony device from availableDevices.
- *
- * @param {HIDDevice[]} availableDevices -.
- * @returns {HIDDevice} -.
- */
- private getTelephonyDevice(availableDevices: HIDDevice[]) {
- if (!availableDevices?.length) {
- logger.warn('No HID device to request');
-
- return undefined;
- }
-
- return availableDevices?.find(device => this.findTelephonyCollectionInfo(device.collections));
- }
-
- /**
- * Find telephony collection info from a list of collection infos.
- *
- * @private
- * @param {HIDCollectionInfo[]} deviceCollections -.
- * @returns {HIDCollectionInfo} - Hid collection info.
- */
- private findTelephonyCollectionInfo(deviceCollections: HIDCollectionInfo[]) {
- return deviceCollections?.find(
- (collection: HIDCollectionInfo) => collection.usagePage === TELEPHONY_DEVICE_USAGE_PAGE
- );
- }
-
- /**
- * Open the hid device and start listening to inputReport events.
- *
- * @param {HIDDevice} telephonyDevice -.
- * @returns {void} -.
- */
- private async open(telephonyDevice: HIDDevice) {
- try {
- this.deviceInfo = { device: telephonyDevice } as IDeviceInfo;
-
- if (!this.deviceInfo?.device) {
- logger.warn('no HID device found');
-
- return;
- }
-
- if (!this.deviceInfo.device.opened) {
- await this.deviceInfo.device.open();
- }
-
- this.isParseDescriptorsSuccess = await this.parseDeviceDescriptors(this.deviceInfo.device);
-
- if (!this.isParseDescriptorsSuccess) {
- logger.warn('Failed to parse webhid');
-
- return;
- }
-
- this.dispatchEvent(new CustomEvent(EVENT_TYPE.INIT_DEVICE, { detail: {
- deviceInfo: {
- ...this.deviceInfo
- } as IDeviceInfo } }));
-
- // listen for input reports by registering an oninputreport event listener
- this.deviceInfo.device.oninputreport = await this.handleInputReport.bind(this);
-
- this.resetDeviceState();
- } catch (e) {
- logger.error(`Error content open device:${e}`);
- }
- }
-
- /**
- * Close device and reset state.
- *
- * @returns {void}
- */
- async close() {
- try {
- await this.resetDeviceState();
-
- if (this.availableDevices) {
- logger.info('clear available devices list');
- this.availableDevices = [];
- }
-
- if (!this.deviceInfo) {
- return;
- }
-
- if (this.deviceInfo?.device?.opened) {
- await this.deviceInfo.device.close();
- }
-
- if (this.deviceInfo.device) {
- this.deviceInfo.device.oninputreport = null;
- }
- this.deviceInfo = {} as IDeviceInfo;
- } catch (e) {
- logger.error(e);
- }
- }
-
- /**
- * Get paired hid devices.
- *
- * @returns {HIDDevice[]}
- */
- async loadPairedDevices() {
- try {
- // @ts-ignore
- const devices = await navigator.hid.getDevices();
-
- this.availableDevices = devices;
-
- return devices;
- } catch (e) {
- logger.error('loadPairedDevices error:', e);
- }
- }
-
- /**
- * Parse device descriptors - input and output reports.
- *
- * @param {HIDDevice} device -.
- * @returns {boolean} - True if descriptors have been parsed with success.
- */
- parseDeviceDescriptors(device: HIDDevice) {
- try {
- this.outputEventGenerators = {};
-
- if (!device?.collections) {
- logger.error('Undefined device collection');
-
- return false;
- }
-
- const telephonyCollection = this.findTelephonyCollectionInfo(device.collections);
-
- if (!telephonyCollection || Object.keys(telephonyCollection).length === 0) {
- logger.error('No telephony collection');
-
- return false;
- }
-
- if (telephonyCollection.inputReports) {
- if (!this.parseInputReports(telephonyCollection.inputReports)) {
- logger.warn('parse inputReports failed');
-
- return false;
- }
- logger.warn('parse inputReports success');
-
- }
-
- if (telephonyCollection.outputReports) {
- if (!this.parseOutputReports(telephonyCollection.outputReports)) {
- logger.warn('parse outputReports failed');
-
- return false;
- }
- logger.warn('parse outputReports success');
-
- return true;
-
- }
-
- logger.warn('parseDeviceDescriptors: returns false, end');
-
- return false;
- } catch (e) {
- logger.error(`parseDeviceDescriptors error:${JSON.stringify(e, null, ' ')}`);
-
- return false;
- }
- }
-
- /**
- * HandleInputReport.
- *
- * @param {HIDInputReportEvent} event -.
- * @returns {void} -.
- */
- handleInputReport(event: HIDInputReportEvent) {
- try {
- const { data, device, reportId } = event;
-
- if (reportId === 0) {
- logger.warn('handleInputReport: ignore invalid reportId');
-
- return;
- }
-
- const inputReport = this.deviceCommand.inputReport;
-
- logger.warn(`current inputReport:${JSON.stringify(inputReport, null, ' ')}, reporId: ${reportId}`);
- if (reportId !== inputReport.hookSwitch.reportId && reportId !== inputReport.phoneMute.reportId) {
- logger.warn('handleInputReport:ignore unknown reportId');
-
- return;
- }
-
- let hookStatusChange = false;
- let muteStatusChange = false;
-
- const reportData = new Uint8Array(data.buffer);
- const needReply = true;
-
- if (reportId === inputReport.hookSwitch.reportId) {
- const item = inputReport.hookSwitch;
- const byteIndex = Math.trunc(item.usageOffset / 8);
- const bitPosition = item.usageOffset % 8;
- // eslint-disable-next-line no-bitwise
- const usageOn = (data.getUint8(byteIndex) & (0x01 << bitPosition)) !== 0;
-
- logger.warn('recv hookSwitch ', usageOn ? HOOK_STATUS.OFF : HOOK_STATUS.ON);
- if (inputReport.hookSwitch.isAbsolute) {
- if (this.deviceInfo.hookStatus === HOOK_STATUS.ON && usageOn) {
- this.deviceInfo.hookStatus = HOOK_STATUS.OFF;
- hookStatusChange = true;
- } else if (this.deviceInfo.hookStatus === HOOK_STATUS.OFF && !usageOn) {
- this.deviceInfo.hookStatus = HOOK_STATUS.ON;
- hookStatusChange = true;
- }
- } else if (usageOn) {
- this.deviceInfo.hookStatus = this.deviceInfo.hookStatus === HOOK_STATUS.OFF
- ? HOOK_STATUS.ON : HOOK_STATUS.OFF;
- hookStatusChange = true;
- }
- }
-
- if (reportId === inputReport.phoneMute.reportId) {
- const item = inputReport.phoneMute;
- const byteIndex = Math.trunc(item.usageOffset / 8);
- const bitPosition = item.usageOffset % 8;
- // eslint-disable-next-line no-bitwise
- const usageOn = (data.getUint8(byteIndex) & (0x01 << bitPosition)) !== 0;
-
- logger.warn('recv phoneMute ', usageOn ? HOOK_STATUS.ON : HOOK_STATUS.OFF);
- if (inputReport.phoneMute.isAbsolute) {
- if (this.deviceInfo.muted !== usageOn) {
- this.deviceInfo.muted = usageOn;
- muteStatusChange = true;
- }
- } else if (usageOn) {
- this.deviceInfo.muted = !this.deviceInfo.muted;
- muteStatusChange = true;
- }
- }
-
- const inputReportData = {
- productName: device.productName,
- reportId: this.getHexByte(reportId),
- reportData,
- eventName: '',
- isMute: false,
- hookStatus: ''
- };
-
- if (hookStatusChange) {
- // Answer key state change
- inputReportData.eventName = INPUT_REPORT_EVENT_NAME.ON_DEVICE_HOOK_SWITCH;
- inputReportData.hookStatus = this.deviceInfo.hookStatus;
- logger.warn(`hook status change: ${this.deviceInfo.hookStatus}`);
- }
-
- if (muteStatusChange) {
- // Mute key state change
- inputReportData.eventName = INPUT_REPORT_EVENT_NAME.ON_DEVICE_MUTE_SWITCH;
- inputReportData.isMute = this.deviceInfo.muted;
- logger.warn(`mute status change: ${this.deviceInfo.muted}`);
- }
-
- const actionResult = this.extractActionResult(inputReportData);
-
- this.dispatchEvent(
- new CustomEvent(EVENT_TYPE.UPDATE_DEVICE, {
- detail: {
- actionResult,
- deviceInfo: this.deviceInfo
- }
- })
- );
-
- logger.warn(
- `hookStatusChange=${
- hookStatusChange
- }, muteStatusChange=${
- muteStatusChange
- }, needReply=${
- needReply}`
- );
- if (needReply && (hookStatusChange || muteStatusChange)) {
- let newOffHook;
-
- if (this.deviceInfo.hookStatus === HOOK_STATUS.OFF) {
- newOffHook = true;
- } else if (this.deviceInfo.hookStatus === HOOK_STATUS.ON) {
- newOffHook = false;
- } else {
- logger.warn('Invalid hook status');
-
- return;
- }
- this.sendReplyReport(reportId, newOffHook, this.deviceInfo.muted);
- } else {
- logger.warn(`Not sending reply report: needReply ${needReply},
- hookStatusChange: ${hookStatusChange}, muteStatusChange: ${muteStatusChange}`);
- }
- } catch (e) {
- logger.error(e);
- }
- }
-
- /**
- * Extract action result.
- *
- * @private
- * @param {*} data -.
- * @returns {{eventName: string}} - EventName.
- */
- private extractActionResult(data: any) {
- switch (data.eventName) {
- case INPUT_REPORT_EVENT_NAME.ON_DEVICE_HOOK_SWITCH:
- return {
- eventName: data.hookStatus === HOOK_STATUS.ON
- ? ACTION_HOOK_TYPE_NAME.HOOK_SWITCH_ON : ACTION_HOOK_TYPE_NAME.HOOK_SWITCH_OFF
- };
- case INPUT_REPORT_EVENT_NAME.ON_DEVICE_MUTE_SWITCH:
- return {
- eventName: data.isMute ? ACTION_HOOK_TYPE_NAME.MUTE_SWITCH_ON : ACTION_HOOK_TYPE_NAME.MUTE_SWITCH_OFF
- };
- case 'ondevicevolumechange':
- return {
- eventName: data.volumeStatus === 'up'
- ? ACTION_HOOK_TYPE_NAME.VOLUME_CHANGE_UP : ACTION_HOOK_TYPE_NAME.VOLUME_CHANGE_DOWN
- };
- default:
- break;
- }
- }
-
- /**
- * Reset device state.
- *
- * @returns {void} -.
- */
- resetDeviceState() {
- if (!this.deviceInfo?.device?.opened) {
- return;
- }
-
- this.deviceInfo.hookStatus = HOOK_STATUS.ON;
- this.deviceInfo.muted = false;
- this.deviceInfo.ring = false;
- this.deviceInfo.hold = false;
-
- this.sendDeviceReport({ command: COMMANDS.ON_HOOK });
- this.sendDeviceReport({ command: COMMANDS.MUTE_OFF });
- }
-
- /**
- * Parse input reports.
- *
- * @param {HIDReportInfo[]} inputReports -.
- * @returns {void} -.
- */
- private parseInputReports(inputReports: HIDReportInfo[]) {
- inputReports.forEach(report => {
- if (!report?.items?.length || report.reportId === undefined) {
- return;
- }
-
- let usageOffset = 0;
-
- report.items.forEach((item: HIDReportItem) => {
- if (
- item.usages === undefined
- || item.reportSize === undefined
- || item.reportCount === undefined
- || item.isAbsolute === undefined
- ) {
- logger.warn('parseInputReports invalid parameters!');
-
- return;
- }
-
- const reportSize = item.reportSize ?? 0;
- const reportId = report.reportId ?? 0;
-
- item.usages.forEach((usage: number, i: number) => {
- switch (usage) {
- case DEVICE_USAGE.hookSwitch.usageId:
- this.deviceCommand.inputReport.hookSwitch = {
- reportId,
- usageOffset: usageOffset + (i * reportSize),
- isAbsolute: item.isAbsolute ?? false
- };
- break;
- case DEVICE_USAGE.phoneMute.usageId:
- this.deviceCommand.inputReport.phoneMute = {
- reportId,
- usageOffset: usageOffset + (i * reportSize),
- isAbsolute: item.isAbsolute ?? false
- };
- break;
- default:
- break;
- }
- });
-
- usageOffset += item.reportCount * item.reportSize;
- });
- });
-
- if (!this.deviceCommand.inputReport.phoneMute || !this.deviceCommand.inputReport.hookSwitch) {
- logger.warn('parseInputReports - no phoneMute or hookSwitch. Skip. Returning false');
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Parse output reports.
- *
- * @private
- * @param {HIDReportInfo[]} outputReports -.
- * @returns {void} -.
- */
- private parseOutputReports(outputReports: HIDReportInfo[]) {
- outputReports.forEach((report: HIDReportInfo) => {
- if (!report?.items?.length || report.reportId === undefined) {
- return;
- }
-
- let usageOffset = 0;
- const usageOffsetMap: Map<number, number> = new Map();
-
- report.items.forEach(item => {
- if (item.usages === undefined || item.reportSize === undefined || item.reportCount === undefined) {
- logger.warn('parseOutputReports invalid parameters!');
-
- return;
- }
-
- const reportSize = item.reportSize ?? 0;
- const reportId = report.reportId ?? 0;
-
- item.usages.forEach((usage: number, i: number) => {
- switch (usage) {
- case DEVICE_USAGE.mute.usageId:
- this.deviceCommand.outputReport.mute = {
- reportId,
- usageOffset: usageOffset + (i * reportSize)
- };
- usageOffsetMap.set(usage, usageOffset + (i * reportSize));
- break;
- case DEVICE_USAGE.offHook.usageId:
- this.deviceCommand.outputReport.offHook = {
- reportId,
- usageOffset: usageOffset + (i * reportSize)
- };
- usageOffsetMap.set(usage, usageOffset + (i * reportSize));
- break;
- case DEVICE_USAGE.ring.usageId:
- this.deviceCommand.outputReport.ring = {
- reportId,
- usageOffset: usageOffset + (i * reportSize)
- };
- usageOffsetMap.set(usage, usageOffset + (i * reportSize));
- break;
- case DEVICE_USAGE.hold.usageId:
- this.deviceCommand.outputReport.hold = {
- reportId,
- usageOffset: usageOffset = i * reportSize
- };
- usageOffsetMap.set(usage, usageOffset + (i * reportSize));
- break;
- default:
- break;
- }
- });
-
- usageOffset += item.reportCount * item.reportSize;
- });
-
- const reportLength = usageOffset;
-
- for (const [ usage, offset ] of usageOffsetMap) {
- this.outputEventGenerators[usage] = (val: number) => {
- const reportData = new Uint8Array(reportLength / 8);
-
- if (offset >= 0 && val) {
- const byteIndex = Math.trunc(offset / 8);
- const bitPosition = offset % 8;
-
- // eslint-disable-next-line no-bitwise
- reportData[byteIndex] = 1 << bitPosition;
- }
-
- return reportData;
- };
- }
- });
-
- let hook, mute, ring;
-
- for (const item in this.outputEventGenerators) {
- if (Object.prototype.hasOwnProperty.call(this.outputEventGenerators, item)) {
- let newItem = this.getHexByte(item);
-
- newItem = `0x0${newItem}`;
- if (DEVICE_USAGE.mute.usageId === Number(newItem)) {
- mute = this.outputEventGenerators[DEVICE_USAGE.mute.usageId];
- } else if (DEVICE_USAGE.offHook.usageId === Number(newItem)) {
- hook = this.outputEventGenerators[DEVICE_USAGE.offHook.usageId];
- } else if (DEVICE_USAGE.ring.usageId === Number(newItem)) {
- ring = this.outputEventGenerators[DEVICE_USAGE.ring.usageId];
- }
- }
- }
- if (!mute && !ring && !hook) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Send device report.
- *
- * @param {{ command: string }} data -.
- * @returns {void} -.
- */
- async sendDeviceReport(data: { command: string; }) {
- if (!data?.command || !this.deviceInfo?.device?.opened || !this.isParseDescriptorsSuccess) {
- logger.warn('There are currently non-compliant conditions');
-
- return;
- }
-
- logger.warn(`sendDeviceReport data.command: ${data.command}`);
-
- if (data.command === COMMANDS.MUTE_ON || data.command === COMMANDS.MUTE_OFF) {
- if (!this.outputEventGenerators[DEVICE_USAGE.mute.usageId]) {
- logger.warn('current no parse mute event');
-
- return;
- }
- } else if (data.command === COMMANDS.ON_HOOK || data.command === COMMANDS.OFF_HOOK) {
- if (!this.outputEventGenerators[DEVICE_USAGE.offHook.usageId]) {
- logger.warn('current no parse offHook event');
-
- return;
- }
- } else if (data.command === COMMANDS.ON_RING || data.command === COMMANDS.OFF_RING) {
- if (!this.outputEventGenerators[DEVICE_USAGE.ring.usageId]) {
- logger.warn('current no parse ring event');
-
- return;
- }
- }
-
- let oldOffHook;
- let newOffHook;
- let newMuted;
- let newRing;
- let newHold;
- let offHookReport;
- let muteReport;
- let ringReport;
- let holdReport;
- let reportData = new Uint8Array();
-
- const reportId = this.matchReportId(data.command);
-
- if (reportId === 0) {
- logger.warn(`Unsupported command ${data.command}`);
-
- return;
- }
-
- /* keep old status. */
- const oldMuted = this.deviceInfo.muted;
-
- if (this.deviceInfo.hookStatus === HOOK_STATUS.OFF) {
- oldOffHook = true;
- } else if (this.deviceInfo.hookStatus === HOOK_STATUS.ON) {
- oldOffHook = false;
- } else {
- logger.warn('Invalid hook status');
-
- return;
- }
-
- const oldRing = this.deviceInfo.ring;
- const oldHold = this.deviceInfo.hold;
-
- logger.warn(
- `send device command: old_hook=${oldOffHook}, old_muted=${oldMuted}, old_ring=${oldRing}`
- );
-
- /* get new status. */
- switch (data.command) {
- case COMMANDS.MUTE_ON:
- newMuted = true;
- break;
- case COMMANDS.MUTE_OFF:
- newMuted = false;
- break;
- case COMMANDS.ON_HOOK:
- newOffHook = false;
- break;
- case COMMANDS.OFF_HOOK:
- newOffHook = true;
- break;
- case COMMANDS.ON_RING:
- newRing = true;
- break;
- case COMMANDS.OFF_RING:
- newRing = false;
- break;
- case COMMANDS.ON_HOLD:
- newHold = true;
- break;
- case COMMANDS.OFF_HOLD:
- newHold = false;
- break;
- default:
- logger.info(`Unknown command ${data.command}`);
-
- return;
- }
- logger.warn(
- `send device command: new_hook = ${newOffHook}, new_muted = ${newMuted},
- new_ring = ${newRing} new_hold = ${newHold}`
- );
-
- if (this.outputEventGenerators[DEVICE_USAGE.mute.usageId]) {
- if (newMuted === undefined) {
- muteReport = this.outputEventGenerators[DEVICE_USAGE.mute.usageId](oldMuted);
- } else {
- muteReport = this.outputEventGenerators[DEVICE_USAGE.mute.usageId](newMuted);
- }
- }
-
- if (this.outputEventGenerators[DEVICE_USAGE.offHook.usageId]) {
- if (newOffHook === undefined) {
- offHookReport = this.outputEventGenerators[DEVICE_USAGE.offHook.usageId](oldOffHook);
- } else {
- offHookReport = this.outputEventGenerators[DEVICE_USAGE.offHook.usageId](newOffHook);
- }
- }
-
- if (this.outputEventGenerators[DEVICE_USAGE.ring.usageId]) {
- if (newRing === undefined) {
- ringReport = this.outputEventGenerators[DEVICE_USAGE.ring.usageId](oldRing);
- } else {
- ringReport = this.outputEventGenerators[DEVICE_USAGE.ring.usageId](newRing);
- }
- }
-
- if (this.outputEventGenerators[DEVICE_USAGE.hold.usageId]) {
- holdReport = this.outputEventGenerators[DEVICE_USAGE.hold.usageId](oldHold);
- }
-
- if (reportId === this.deviceCommand.outputReport.mute.reportId) {
- reportData = new Uint8Array(muteReport);
- }
-
- if (reportId === this.deviceCommand.outputReport.offHook.reportId) {
- reportData = new Uint8Array(offHookReport);
- }
-
- if (reportId === this.deviceCommand.outputReport.ring.reportId) {
- reportData = new Uint8Array(ringReport);
- }
-
- if (reportId === this.deviceCommand.outputReport.hold.reportId) {
- reportData = new Uint8Array(holdReport);
- }
-
- logger.warn(`[sendDeviceReport] send device command (before call webhid API)
- ${data.command}: reportId=${reportId}, reportData=${reportData}`);
- logger.warn(`reportData is ${JSON.stringify(reportData, null, ' ')}`);
- await this.deviceInfo.device.sendReport(reportId, reportData);
-
- /* update new status. */
- this.updateDeviceStatus(data);
- }
-
- /**
- * Update device status.
- *
- * @private
- * @param {{ command: string; }} data -.
- * @returns {void}
- */
- private updateDeviceStatus(data: { command: string; }) {
- switch (data.command) {
- case COMMANDS.MUTE_ON:
- this.deviceInfo.muted = true;
- break;
- case COMMANDS.MUTE_OFF:
- this.deviceInfo.muted = false;
- break;
- case COMMANDS.ON_HOOK:
- this.deviceInfo.hookStatus = HOOK_STATUS.ON;
- break;
- case COMMANDS.OFF_HOOK:
- this.deviceInfo.hookStatus = HOOK_STATUS.OFF;
- break;
- case COMMANDS.ON_RING:
- this.deviceInfo.ring = true;
- break;
- case COMMANDS.OFF_RING:
- this.deviceInfo.ring = false;
- break;
- case COMMANDS.ON_HOLD:
- this.deviceInfo.hold = true;
- break;
- case COMMANDS.OFF_HOLD:
- this.deviceInfo.hold = false;
- break;
- default:
- logger.warn(`Unknown command ${data.command}`);
- break;
- }
- logger.warn(
- `[updateDeviceStatus] device status after send command: hook=${this.deviceInfo.hookStatus},
- muted=${this.deviceInfo.muted}, ring=${this.deviceInfo.ring}`
- );
- }
-
- /**
- * Math given command with known commands.
- *
- * @private
- * @param {string} command -.
- * @returns {number} ReportId.
- */
- private matchReportId(command: string) {
- switch (command) {
- case COMMANDS.MUTE_ON:
- case COMMANDS.MUTE_OFF:
- return this.deviceCommand.outputReport.mute.reportId;
- case COMMANDS.ON_HOOK:
- case COMMANDS.OFF_HOOK:
- return this.deviceCommand.outputReport.offHook.reportId;
- case COMMANDS.ON_RING:
- case COMMANDS.OFF_RING:
- return this.deviceCommand.outputReport.ring.reportId;
- case COMMANDS.ON_HOLD:
- case COMMANDS.OFF_HOLD:
- return this.deviceCommand.outputReport.hold.reportId;
- default:
- logger.info(`Unknown command ${command}`);
-
- return 0;
- }
- }
-
- /**
- * Send reply report to device.
- *
- * @param {number} inputReportId -.
- * @param {(string | boolean | undefined)} curOffHook -.
- * @param {(string | undefined)} curMuted -.
- * @returns {void} -.
- */
- private async sendReplyReport(
- inputReportId: number,
- curOffHook: string | boolean | undefined,
- curMuted: boolean | string | undefined
- ) {
- const reportId = this.retriveInputReportId(inputReportId);
-
-
- if (!this.deviceInfo?.device?.opened) {
- logger.warn('[sendReplyReport] device is not opened or does not exist');
-
- return;
- }
-
- if (reportId === 0 || curOffHook === undefined || curMuted === undefined) {
- logger.warn(`[sendReplyReport] return, provided data not valid,
- reportId: ${reportId}, curOffHook: ${curOffHook}, curMuted: ${curMuted}`);
-
- return;
- }
-
- let reportData = new Uint8Array();
- let muteReport;
- let offHookReport;
- let ringReport;
-
- if (this.deviceCommand.outputReport.offHook.reportId === this.deviceCommand.outputReport.mute.reportId) {
- muteReport = this.outputEventGenerators[DEVICE_USAGE.mute.usageId](curMuted);
- offHookReport = this.outputEventGenerators[DEVICE_USAGE.offHook.usageId](curOffHook);
- reportData = new Uint8Array(offHookReport);
- for (const [ i, data ] of muteReport.entries()) {
- // eslint-disable-next-line no-bitwise
- reportData[i] |= data;
- }
- } else if (reportId === this.deviceCommand.outputReport.offHook.reportId) {
- offHookReport = this.outputEventGenerators[DEVICE_USAGE.offHook.usageId](curOffHook);
- reportData = new Uint8Array(offHookReport);
- } else if (reportId === this.deviceCommand.outputReport.mute.reportId) {
- muteReport = this.outputEventGenerators[DEVICE_USAGE.mute.usageId](curMuted);
- reportData = new Uint8Array(muteReport);
- } else if (reportId === this.deviceCommand.outputReport.ring.reportId) {
- ringReport = this.outputEventGenerators[DEVICE_USAGE.mute.usageId](curMuted);
- reportData = new Uint8Array(ringReport);
- }
-
- logger.warn(`[sendReplyReport] send device reply: reportId=${reportId}, reportData=${reportData}`);
- await this.deviceInfo.device.sendReport(reportId, reportData);
- }
-
- /**
- * Retrieve input report id.
- *
- * @private
- * @param {number} inputReportId -.
- * @returns {number} ReportId -.
- */
- private retriveInputReportId(inputReportId: number) {
- let reportId = 0;
-
- if (this.deviceCommand.outputReport.offHook.reportId === this.deviceCommand.outputReport.mute.reportId) {
- reportId = this.deviceCommand.outputReport.offHook.reportId;
- } else if (inputReportId === this.deviceCommand.inputReport.hookSwitch.reportId) {
- reportId = this.deviceCommand.outputReport.offHook.reportId;
- } else if (inputReportId === this.deviceCommand.inputReport.phoneMute.reportId) {
- reportId = this.deviceCommand.outputReport.mute.reportId;
- }
-
- return reportId;
- }
-
- /**
- * Get the hexadecimal bytes.
- *
- * @param {number|string} data -.
- * @returns {string}
- */
- getHexByte(data: number | string) {
- let hex = Number(data).toString(16);
-
- while (hex.length < 2) {
- hex = `0${hex}`;
- }
-
- return hex;
- }
-}
diff --git a/tsconfig.native.json b/tsconfig.native.json
index 6a3210c8b0..ae206e7846 100644
--- a/tsconfig.native.json
+++ b/tsconfig.native.json
@@ -37,7 +37,6 @@
"react/features/screenshot-capture",
"react/features/stream-effects",
"react/features/virtual-background",
- "react/features/web-hid",
"react/features/whiteboard",
"**/web/*",
"**/*.web.ts",