Expand description
JS-bridge bindings for the M-CAM.2 Tauri camera commands (M-CAM.4 / AUT-258 + M-REC.1 / AUT-260).
Mirrors crate::player_ipc for the camera surface. Each function
invokes a __screen* helper declared in index.html’s inline
script, which in turn wraps window.__TAURI__.core.invoke(...).
The returned values come back as JsValue and are deserialised
into typed Rust structs via serde_wasm_bindgen — the same
pattern the player IPC layer uses.
Structs§
- AllPermissions
Result - Result of
request_all_permissions— final TCC status for each protected resource. - Camera
View - Mirror of
crates/app/src/commands.rs::CameraView(M-CAM.2).
Enums§
- Camera
Permission - Mirror of
crates/app/src/commands.rs::CameraPermission(M-CAM.2).
Functions§
- camera_
permission_ status - Async helper: probe OS camera permission state.
- camera_
permission_ status_ js __screenCameraPermissionStatus()inindex.html— returnsPromise<CameraPermission>.- list_
cameras - Async helper: list every camera the OS exposes.
- list_
cameras_ js __screenListCameras()inindex.html— returnsPromise<CameraView[]>.- open_
settings_ camera - Async helper: shell out to open System Settings → Camera
(M-RECP.0 / AUT-261). Silently no-ops outside Tauri (so
trunk servedev doesn’t error on click) and silently swallows spawn errors — the user-facing “tell me if I can’t open this” case is rare enough that surfacing it adds more noise than value. - open_
settings_ camera_ js __screenOpenSettingsCamera()(M-RECP.0 / AUT-261) — shells out to open System Settings → Privacy & Security → Camera.- request_
all_ permissions - Async helper: fire the macOS TCC prompts (M-PIX.9). Returns the
post-prompt statuses. Outside Tauri this returns
Grantedfor every channel so the picker UX intrunk serveis unaffected. - request_
all_ permissions_ js __screenRequestAllPermissions()(M-PIX.9) — fires the macOS TCC prompts for Camera + Mic + Screen Recording. Returns{ camera, microphone, screen_recording }statuses.- start_
preview - Async helper: kick off
start_previewfor the given camera id. - start_
preview_ js __screenStartPreview(cameraId)inindex.html— returnsPromise<void>.- stop_
preview - Async helper: tear down the active preview.
- stop_
preview_ js __screenStopPreview()inindex.html— returnsPromise<void>.