What it is good for
- Visual troubleshooting. The user shows the broken thing and describes the problem.
- Guided physical tasks. Assembly, installation or setup, with the user’s hands free.
- Reading documents. The user holds up a card, a label or a form.
- Anything that is easier to show than to describe.
The agent sees up to one still image per second. It is not a video call. The agent cannot follow motion or gestures. See What the agent can see.
Turn the camera on or off
Camera sessions are on by default for every agent. The setting isenable_webcam. It is the same setting the dashboard and the embed widget use.
PATCH only changes the flags you send. All other settings stay the same.
When the camera is off, creating a camera session fails with 403:
4003. Handle both.
Build a camera page
1
Create a camera session on your server
Use the token endpoint from Voice in the browser. The library adds
?source=camera to the request, and the endpoint passes it on. If you write your own endpoint, set source to camera:token-endpoint.mjs
2
Start the session with a video element
Pass
source: "camera" and a <video> element for the preview:camera.html
Image settings
Set these on theEclatiraSession constructor. The defaults work well for most cameras.
The agent needs the microphone too
When images keep arriving with no audio, the server sends this once, after about 8 seconds:- No audio track. You called
getUserMedia({ video: true })withoutaudio: true. - Audio at the wrong sample rate. The audio arrives, so
no_audio_receiveddoes not fire. But the agent cannot understand it. See Media format. The library fixes this for you.
Handle camera problems
Permission denied
getUserMedia throws an error when it fails. The library asks for the camera before it creates the session, so a denied camera does not use up a session. Show a clear message for each case:
- The camera only works on
https://pages andhttp://localhost. Testing from a phone against your laptop’s IP address overhttp://fails. - Ask for the camera and the microphone in one call. If you ask separately and only the microphone fails, you get a video-only session that never replies.
The camera stops during the session
A camera can stop on its own. The user unplugs it, another app takes it, or the system revokes access. The socket stays open, but images stop. Listen for it:End the session cleanly
session.stop() stops the image timer, closes the socket, stops every track and releases the preview. The camera light turns off.
If you build without the library, stop every track. Closing the socket is not enough. The camera light stays on until each track is stopped:
What the agent can see
The agent gets up to one new still image per second. Each image stands alone. Write your agent’s instructions with this in mind.Works well
Does not work
Agent instruction
Limits
- Images are not stored. You cannot read them back later.
- The session type is fixed. You cannot turn on the camera during an
audiosession. Start a newcamerasession instead. The conversation does not carry over. - Build without the library? Media format has the full image pipeline.