Place and control 1:1 video calls with camera, torch, and switches.
Video Calls
Start a 1:1 video call with mediaType: 'video'.
Start a call
const call = await client.startCall({
calleeId: 'bob',
mediaType: 'video',
});Or use CallingScreen and choose video from the dialer / demo UI.
Incoming video
On the incoming screen:
- Local camera preview can show while ringing (when joining with video)
- Caller may toggle join with video off to answer as audio
- Accept is still swipe up on the green control (video camera icon when joining with video)
- Decline remains a single tap on red
Details: Incoming Calls.
In-call controls
await client.setVideoEnabled(false); // camera off
await client.switchCamera(); // front ↔ back
await client.setTorch(true); // when torchAvailable
await client.setMuted(true);
await client.setSpeaker(true);
await client.end();| Method | Purpose |
|---|---|
setVideoEnabled(enabled) | Enable / disable local camera track |
switchCamera() | Flip facing mode |
setTorch(enabled) | Flash when supported (torchAvailable on the call) |
setMuted / setSpeaker / end | Same as voice |
Rendering video
Use the packaged views:
import { LocalVideoView, RemoteVideoView } from '@alaznah/calling';
<LocalVideoView stream={call.localStream} mirror objectFit="cover" />
<RemoteVideoView stream={call.remoteStream} objectFit="cover" />CallingUI / ActiveCallScreen wire these automatically for the default experience.
Permissions
await requestCallPermissions({ video: true });You need both microphone and camera usage descriptions / permissions — see Permissions.
Config tips
{
facingMode: 'user', // or 'environment'
// ...
}