Set up video calls with the Sinch JavaScript Voice and Video SDK.
Video calls follow the same flow as audio calls. Use CallClient.callUserVideo() to start a video call with a specific user. You’ll receive the same callbacks as for audio: progressing, ringing, answered, and established. For lifecycle details, see Audio calling.
Once you have a Call, you can access two MediaStreams:
incomingStream— remote stream sent to your appoutgoingStream— your local stream sent to the other party
Access them via Call.incomingStream and Call.outgoingStream.
Bind the appropriate stream to a <video> element by setting srcObject:
const videoElement = document.getElementById(`${direction}-video`);
videoElement.srcObject = call.incomingStream;Use Call.pauseVideo() to temporarily stop sending your local video (for privacy or to save bandwidth). Use Call.resumeVideo to start sending it again. Audio continues unless you mute it separately.
To select a specific camera, set the deviceId constraint via CallClient.setVideoTrackConstraints().
sinchClient.callClient.setVideoTrackConstraints({
deviceId: { exact: <yourVideoDeviceId> },
});For a full sample of input/output device selection, see the reference app.