@dornick/mounts-media
v0.1.0
Published
Media VFS mounts for Dornick — Camera, Microphone, BarcodeDetector, MediaDevices, ScreenCapture. Each capability-gated.
Readme
@dornick/mounts-media
Media VFS mounts for Dornick — Camera, Microphone, BarcodeDetector, MediaDevices, ScreenCapture.
Tree-shakable. Each mount is capability-gated; on unsupported browsers, static available(caps) returns false and dornick.mount(...) is a no-op.
Install
npm i @dornick/mounts-mediaUse
import { Dornick } from "@dornick/core";
import {
CameraMount,
MicrophoneMount,
BarcodeMount,
MediaDevicesMount,
ScreenCaptureMount,
} from "@dornick/mounts-media";
const dornick = new Dornick({ config, transport });
dornick.mount("/host/camera", new CameraMount({ facingMode: "environment" }));
dornick.mount("/host/mic", new MicrophoneMount());
dornick.mount("/host/barcode", new BarcodeMount());
dornick.mount("/host/devices", new MediaDevicesMount());
dornick.mount("/host/screen", new ScreenCaptureMount());Paths exposed
| Mount | Path | Operations |
|---|---|---|
| CameraMount | capture.json | write to trigger capture; read for { base64, mimeType, width, height } |
| MicrophoneMount | record.cmd, last.json | write "start" / "stop"; read last recording |
| BarcodeMount | formats.json, scan.cmd, last.json | write a data URL or HTTP URL to scan |
| MediaDevicesMount | list.json | read enumerated devices |
| ScreenCaptureMount | capture.json | write to trigger; read for the captured frame |
Capability gates
| Mount | Gate |
|---|---|
| CameraMount | apis.camera |
| MicrophoneMount | apis.microphone |
| BarcodeMount | apis.barcodeDetector (Chromium / Safari iOS) |
| MediaDevicesMount | navigator.mediaDevices.enumerateDevices |
| ScreenCaptureMount | navigator.mediaDevices.getDisplayMedia |
Pairs nicely with
@dornick/parsers-ocr—CameraMountcapture → OCR → fields@dornick/mounts-hardware— combine with WebAuthn for KYC
See also
License
MIT — © Dipankar Sarkar
