Move screen capture into Rust, out of the webview #36
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
v2
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wayfinder:ticket
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
aiko/denpa#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
画面共有captures withnavigator.mediaDevices.getDisplayMedia(src/renderer/src/context/screen-capture-context.tsx:32). Per the newly recordeddocs/adr/0002-hardware-goes-through-rust.md, that has to move to the Rust layer.This is follow-up work to
aiko/denpa#31, which shipped and works on desktop. Not a revert.Why the browser path cannot stay
getDisplayMedia. Screen capture there isMediaProjection— a system consent dialog plus a foreground service. The design treats a phone and an Android overlay as first-class surfaces, so a capture path that only exists on desktop is not a capture path.RECORD_AUDIOat OS level, granted through our own screen, andgetUserMediastill failed withNotAllowedErrorbecause the Android WebView keeps a separate gate. Pressing 押して送信 on a real tablet advanced the UI to 送信中 and transmitted nothing.Scope
getDisplayMediainscreen-capture-context.tsx.MediaProjectionin Kotlin, with the consent dialog and the foreground service it requires. Coordinate withaiko/denpa#23, which already runs a foreground service for the overlay and had to reason about service types — a second one, or a second type on the same one, needs thought rather than a copy.#31's grant model, its two-key hold, and thescreen-capturemessage to the go-between all stay. Only the acquisition changes.Acceptance
getDisplayMediacall remains in the renderer.画面共有grant stops capture, not merely the UI affordance —#31's existing test for this must still hold.Related
docs/adr/0002-hardware-goes-through-rust.md— the rule.aiko/denpa#35— the same move for microphone capture and VAD.aiko/denpa#31— the grant surface this preserves.aiko/denpa#23— the Android overlay and its existing foreground service.Observed working on Windows, 2026-07-30 — 画面共有 captures and sends today, through the
getDisplayMediapath inscreen-capture-context.tsx:32.Worth stating plainly, because it cuts both ways: it works because of the browser media API that ADR-0002 forbids. So "screen capture works" and "this issue is still needed" are both true at once, and the reasons are the ones this issue already gives — Android has no usable
getDisplayMediaat all, and a webview media API is a third permission layer that#35proved unreliable on exactly this machine.The open question is not whether 画面共有 belongs in v1 — it is working and wanted — but whether the move into Rust is v1 or follows the Android capture path. That is #45.
Deferred to v2 by #45, operator's call 2026-07-30.
画面共有 itself stays in v1 — it works on desktop and is wanted. What waits is this migration, which travels with the Android capture path rather than ahead of it.
Carried forward as accepted cost: the renderer keeps a
getDisplayMediahandle, which ADR-0002 forbids, and screen sharing does not exist on the tablet or the phone until this lands.