Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/i18n/de-DE.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@
"dontAskAgain": "Lassen Sie immer zu, dass Videoanrufe von diesem Server Ihren Bildschirm erfassen",
"yes": "Erlauben",
"no": "Absagen"
},
"mediaPermission": {
"title": "Medienberechtigung Erforderlich",
"message": "Der Zugriff auf {{- permissionType}} ist derzeit in Ihren Systemeinstellungen deaktiviert.",
"detail": "Um Videoanruf-Funktionen zu aktivieren, erlauben Sie bitte den Zugriff in den Datenschutzeinstellungen Ihres Systems und starten Sie dann die Anwendung neu.",
"openSettings": "Einstellungen Öffnen",
"cancel": "Abbrechen",
"microphone": "Mikrofon",
"camera": "Kamera",
"both": "Mikrofon und Kamera"
}
},
"downloads": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@
"yes": "Allow",
"no": "Cancel"
},
"mediaPermission": {
"title": "Media Permission Required",
"message": "{{- permissionType}} access is currently disabled in your system settings.",
"detail": "To enable video calling features, please allow access in your system's privacy settings and then restart the application.",
"openSettings": "Open Settings",
"cancel": "Cancel",
"microphone": "Microphone",
"camera": "Camera",
"both": "Microphone and Camera"
},
"outlookCalendar": {
"title": "Outlook Calendar",
"encryptionUnavailableTitle": "Encryption unavailable",
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@
"yes": "Permitir",
"no": "Cancelar"
},
"mediaPermission": {
"title": "Permiso de Medios Requerido",
"message": "El acceso al {{- permissionType}} está deshabilitado en la configuración de tu sistema.",
"detail": "Para habilitar las funciones de videollamada, por favor permite el acceso en la configuración de privacidad de tu sistema y luego reinicia la aplicación.",
"openSettings": "Abrir Configuración",
"cancel": "Cancelar",
"microphone": "Micrófono",
"camera": "Cámara",
"both": "Micrófono y Cámara"
},
"outlookCalendar": {
"title": "Calendario de Outlook",
"encryptionUnavailableTitle": "Encriptación no disponible",
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/fi.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
"dontAskAgain": "Salli aina tämän palvelimen videopuhelujen ottaa näyttökuva",
"yes": "Salli",
"no": "Peruuta"
},
"mediaPermission": {
"title": "Medialupa Vaaditaan",
"message": "{{- permissionType}} käyttöoikeus on tällä hetkellä poistettu käytöstä järjestelmäasetuksissa.",
"detail": "Ottaaksesi videopuheluominaisuudet käyttöön, salli pääsy järjestelmän yksityisyysasetuksissa ja käynnistä sitten sovellus uudelleen.",
"openSettings": "Avaa Asetukset",
"cancel": "Peruuta",
"microphone": "Mikrofoni",
"camera": "Kamera",
"both": "Mikrofoni ja Kamera"
}
},
"downloads": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/fr.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
"dontAskAgain": "Toujours autoriser les appels vidéo de ce serveur pour capturer votre écran",
"yes": "Autoriser",
"no": "Annuler"
},
"mediaPermission": {
"title": "Autorisation Multimédia Requise",
"message": "L'accès au {{- permissionType}} est actuellement désactivé dans les paramètres de votre système.",
"detail": "Pour activer les fonctionnalités d'appel vidéo, veuillez autoriser l'accès dans les paramètres de confidentialité de votre système, puis redémarrer l'application.",
"openSettings": "Ouvrir les Paramètres",
"cancel": "Annuler",
"microphone": "Microphone",
"camera": "Caméra",
"both": "Microphone et Caméra"
}
},
"downloads": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/hu.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@
"yes": "Engedélyezés",
"no": "Mégse"
},
"mediaPermission": {
"title": "Média Engedély Szükséges",
"message": "A {{- permissionType}} hozzáférés jelenleg le van tiltva a rendszerbeállításokban.",
"detail": "A videohívás funkciók engedélyezéséhez kérjük, engedélyezze a hozzáférést a rendszer adatvédelmi beállításaiban, majd indítsa újra az alkalmazást.",
"openSettings": "Beállítások Megnyitása",
"cancel": "Mégse",
"microphone": "Mikrofon",
"camera": "Kamera",
"both": "Mikrofon és Kamera"
},
"outlookCalendar": {
"title": "Outlook naptár",
"encryptionUnavailableTitle": "A titkosítás nem érhető el",
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/ja.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
"title": "更新をスキップ",
"message": "次回の更新プログラムが利用可能になったときにお知らせします。\n気になる場合は[バージョン情報]メニューから更新プログラムを確認できます。",
"ok": "OK"
},
"mediaPermission": {
"title": "メディア許可が必要",
"message": "{{- permissionType}}へのアクセスは現在システム設定で無効になっています。",
"detail": "ビデオ通話機能を有効にするには、システムのプライバシー設定でアクセスを許可してからアプリケーションを再起動してください。",
"openSettings": "設定を開く",
"cancel": "キャンセル",
"microphone": "マイク",
"camera": "カメラ",
"both": "マイクとカメラ"
}
},
"error": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/no.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@
"yes": "Tillate",
"no": "Kansellere"
},
"mediaPermission": {
"title": "Medietillatelse Påkrevd",
"message": "Tilgang til {{- permissionType}} er for øyeblikket deaktivert i systeminnstillingene dine.",
"detail": "For å aktivere videosamtalefunksjoner, vennligst tillat tilgang i systemets personverninnstillinger og start deretter applikasjonen på nytt.",
"openSettings": "Åpne Innstillinger",
"cancel": "Avbryt",
"microphone": "Mikrofon",
"camera": "Kamera",
"both": "Mikrofon og Kamera"
},
"outlookCalendar": {
"title": "Outlook-kalender",
"encryptionUnavailableTitle": "Kryptering utilgjengelig",
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/pl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@
"announcement": "Wybierz Certyfikat",
"select": "Wybierz",
"validDates": "Ważny od {{-validStart,}} do {{-validExpiry,}}"
},
"mediaPermission": {
"title": "Wymagane Uprawnienie Mediów",
"message": "Dostęp do {{- permissionType}} jest obecnie wyłączony w ustawieniach systemu.",
"detail": "Aby włączyć funkcje rozmów wideo, proszę zezwolić na dostęp w ustawieniach prywatności systemu, a następnie uruchomić ponownie aplikację.",
"openSettings": "Otwórz Ustawienia",
"cancel": "Anuluj",
"microphone": "Mikrofon",
"camera": "Kamera",
"both": "Mikrofon i Kamera"
}
},
"settings": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/pt-BR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@
"yes": "Permitir",
"no": "Cancelar"
},
"mediaPermission": {
"title": "Permissão de Mídia Necessária",
"message": "O acesso ao {{- permissionType}} está atualmente desabilitado nas configurações do seu sistema.",
"detail": "Para ativar os recursos de videochamada, permita o acesso nas configurações de privacidade do seu sistema e reinicie a aplicação.",
"openSettings": "Abrir Configurações",
"cancel": "Cancelar",
"microphone": "Microfone",
"camera": "Câmera",
"both": "Microfone e Câmera"
},
"supportedVersion": {
"title": "Versão de workspace não suportada"
}
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/ru.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@
"dontAskAgain": "Всегда разрешать делать снимки экрана для видеовызовов с этого сервера",
"yes": "Разрешить",
"no": "Отмена"
},
"mediaPermission": {
"title": "Требуется Разрешение на Медиа",
"message": "Доступ к {{- permissionType}} в настоящее время отключен в настройках вашей системы.",
"detail": "Для включения функций видеозвонков разрешите доступ в настройках конфиденциальности вашей системы и перезапустите приложение.",
"openSettings": "Открыть Настройки",
"cancel": "Отмена",
"microphone": "Микрофон",
"camera": "Камера",
"both": "Микрофон и Камера"
}
},
"downloads": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/tr-TR.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
"title": "Güncellemeyi Atla",
"message": "Bir sonraki güncellemenin ne zaman yapılacağını size bildireceğiz. Fikrinizi değiştirirseniz Hakkında menüsünden güncellemeleri manuel kontrol edebilirsiniz.",
"ok": "TAMAM"
},
"mediaPermission": {
"title": "Medya İzni Gerekli",
"message": "{{- permissionType}} erişimi şu anda sistem ayarlarınızda devre dışı.",
"detail": "Video arama özelliklerini etkinleştirmek için lütfen sistem gizlilik ayarlarınızda erişime izin verin ve ardından uygulamayı yeniden başlatın.",
"openSettings": "Ayarları Aç",
"cancel": "İptal",
"microphone": "Mikrofon",
"camera": "Kamera",
"both": "Mikrofon ve Kamera"
}
},
"settings": {
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/zh-CN.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
"title": "忽略更新",
"message": "我们将会在下次有新的更新版本的时候通知您\n如果您改变主意想安装此处更新,您可以从「关于」的选项中检查更新。",
"ok": "好"
},
"mediaPermission": {
"title": "需要媒体权限",
"message": "{{- permissionType}}访问目前在您的系统设置中已被禁用。",
"detail": "要启用视频通话功能,请在您的系统隐私设置中允许访问,然后重新启动应用程序。",
"openSettings": "打开设置",
"cancel": "取消",
"microphone": "麦克风",
"camera": "摄像头",
"both": "麦克风和摄像头"
}
},
"downloads": {
Expand Down
26 changes: 26 additions & 0 deletions src/ui/main/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,29 @@ export const askForClearScreenCapturePermission = async (

return response === 0;
};

export const askForMediaPermissionSettings = async (
permissionType: 'microphone' | 'camera' | 'both',
parentWindow?: BrowserWindow
): Promise<boolean> => {
parentWindow?.show();

const { response } = await dialog.showMessageBox(
parentWindow ?? (await getRootWindow()),
{
type: 'warning',
buttons: [
t('dialog.mediaPermission.openSettings'),
t('dialog.mediaPermission.cancel'),
],
defaultId: 0,
title: t('dialog.mediaPermission.title'),
message: t('dialog.mediaPermission.message', {
permissionType: t(`dialog.mediaPermission.${permissionType}`),
}),
detail: t('dialog.mediaPermission.detail'),
}
);

return response === 0;
};
22 changes: 22 additions & 0 deletions src/ui/main/rootWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,26 @@ export const setupRootWindow = (): void => {
});
};

const ensureWindowsMediaRegistration = async (): Promise<void> => {
if (process.platform !== 'win32') {
return;
}

try {
const browserWindow = await getRootWindow();
await browserWindow.webContents.executeJavaScript(`
if (!window._rocketChatMediaRegistered) {
window._rocketChatMediaRegistered = true;
navigator.mediaDevices.getUserMedia({ audio: true, video: false })
.then(() => console.log('Media access registered with Windows'))
.catch(() => console.log('Media registration attempted'));
}
`);
} catch (error) {
console.log('Media registration failed:', error);
}
};

export const showRootWindow = async (): Promise<void> => {
const browserWindow = await getRootWindow();

Expand All @@ -420,6 +440,8 @@ export const showRootWindow = async (): Promise<void> => {
}

setupRootWindow();
ensureWindowsMediaRegistration();

resolve();
});
});
Expand Down
19 changes: 10 additions & 9 deletions src/ui/main/serverView/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,19 @@ export const attachGuestWebContentsEvents = async (): Promise<void> => {
console.log('Permission request', permission, details);
switch (permission) {
case 'media': {
if (process.platform !== 'darwin') {
callback(true);
const { mediaTypes = [] } = details as MediaAccessPermissionRequest;

if (process.platform === 'darwin') {
const allowed =
(!mediaTypes.includes('audio') ||
(await systemPreferences.askForMediaAccess('microphone'))) &&
(!mediaTypes.includes('video') ||
(await systemPreferences.askForMediaAccess('camera')));
callback(allowed);
return;
}

const { mediaTypes = [] } = details as MediaAccessPermissionRequest;
const allowed =
(!mediaTypes.includes('audio') ||
(await systemPreferences.askForMediaAccess('microphone'))) &&
(!mediaTypes.includes('video') ||
(await systemPreferences.askForMediaAccess('camera')));
callback(allowed);
callback(true);
return;
}

Expand Down
Loading