api reference
ctx.camera
Their camera, live, while your app is open — a face in the corner of a clip, a mirror, a scan. Fave1 asks them first and never keeps the video.
Calls
const cam = await ctx.camera.open({ facing: 'user', width: 720, height: 720 }); bubble.append(cam.video); // a playing, muted <video playsinline> // …draw cam.video onto your canvas, record it with MediaRecorder… cam.stop(); // or ctx.camera.close() — every camera your app opened
fieldWhat it istype
videoAlready playing and muted. Put it in your panel, or draw it each frameHTMLVideoElement
streamThe camera’s stream — for
MediaRecorder or your own <video>MediaStreamfacing
user (front, the default) or environment (back)stringwidth · heightWhat you asked
open() for — each 64 to 1920, default 720 (outside that range, 720); the browser picks the nearest it hasoptionstop()Turns this camera off.
ctx.camera.active tells you if any is still onfunctionVideo only — sound is a separate permission, ctx.mic. Need camera in your manifest; without it, or with the switch off in Fave1 settings, open() rejects with denied.
What the person sees
The first open() each time your app opens shows Fave1’s line in your panel: Let <your app> use your camera? When they tap Allow, their browser asks for that site. While a camera is on, a red dot sits in your panel’s header. Close your app, close Fave1, or call stop(), and the camera goes off.
Call open() from a button they pressed — “Add my face” — not at launch.
When it doesn’t work
codeWhat happened · what to doretry
deniedNot declared, the switch is off, they tapped Not now, or their browser said no (
reason not-now · browser). closed if open() lands after your app closednoblockedThis site doesn’t let any camera run on it (
reason site). Carry on without the facenounavailableNo camera (
reason none), the page isn’t https (insecure), or no camera can give that width · height (size)nobusyAnother tab or app is using itlater
The rule
Only through ctx.camera. The video stays on their page — save it only when they ask (a clip they keep with
ctx.files, a download), and never send it anywhere else. An app that calls navigator.mediaDevices.getUserMedia itself, opens the camera without a tap, or uploads what it sees gets sent back in review.