Alaznah

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

ts
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

ts
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();
MethodPurpose
setVideoEnabled(enabled)Enable / disable local camera track
switchCamera()Flip facing mode
setTorch(enabled)Flash when supported (torchAvailable on the call)
setMuted / setSpeaker / endSame as voice

Rendering video

Use the packaged views:

tsx
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

ts
await requestCallPermissions({ video: true });

You need both microphone and camera usage descriptions / permissions — see Permissions.

Config tips

ts
{
  facingMode: 'user', // or 'environment'
  // ...
}