The starting camera
Thecamera field sets the camera a session or video starts with. It goes in the same requests as the framing fields: POST /compose/token, POST /static/audio, POST /auto/token and POST /auto/start/configurable. Each value is an offset from the avatar’s own framing. Every field is optional, and a field you leave out has no effect (0, or 1 for zoom). If you leave camera out entirely, the avatar keeps its own framing.
Values outside their supported range are not clamped. They are applied as sent, and the response’s
warnings array gets an entry for each one, for example camera zoom 6.0 is outside its supported range (0.0, 4.0]; applied as is. The token or video is still made. Only NaN and infinity are rejected, with a 422.
Moving the camera during a session
Both session WebSockets,/compose/webrtc/p2p and /compose/webrtc/livekit, accept a binary CAM_ message. It is the ASCII prefix CAM_ followed by little-endian float32 values, in this order. Note that y comes before x:
- Values: send the first 4, the first 7 or all 9 values. Any you leave off have no effect.
- Replacement: each message replaces the whole camera, including the starting
camerafrom the token. Values are offsets from the avatar’s own framing, not from the previous message. Sending0, 0, 0, 1, 0, 0, 0, 0, 0goes back to the avatar’s own framing. - Gliding: the camera cuts to the new setting. To glide instead, add the ASCII tag
LERPand one more float32: the number of seconds the move takes. The glide starts from wherever the camera is now, even partway through an earlier glide. A value of 0 or less is a cut. - Size: a message is 20, 32 or 40 bytes long, or 28, 40 or 48 bytes with
LERP.