fix(windows): grant microphone and camera permissions in WebView2

WebView2 silently denies getUserMedia() unless a PermissionRequested
handler explicitly allows it. macOS was already covered by Info.plist;
Windows had nothing. Adds a COM event handler via with_webview that
auto-approves mic and camera requests so Element Call voice/video
works in the desktop app.

Also includes previously uncommitted changes:
- tauri.conf.json: add media-src / mediastream: to CSP
- Info.plist: macOS NSMicrophoneUsageDescription / NSCameraUsageDescription

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 18:27:12 -04:00
parent 0b7ace5dfa
commit 838c69f46e
4 changed files with 69 additions and 8 deletions
+4
View File
@@ -42,6 +42,10 @@ custom-protocol = [ "tauri/custom-protocol" ]
tauri-plugin-global-shortcut = "2"
tauri-plugin-updater = "2"
[target.'cfg(target_os = "windows")'.dependencies]
webview2-com = "0.38"
windows = { version = "0.61", features = [] }
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]