Setting the initial video state
You can set the initial video state of the local user, which is applied when starting a video call or switching from an audio call to a video call.
| Supported call type | Minimum SDK version |
|---|---|
| 1-to-1 call, group call (conference) | WebPlanetKit 5.2 |
Overview
You can set the initial video state by adding a boolean type cameraOn as an argument to both the call start API and the video call switching API. The initial video state is set as follows depending on the value of cameraOn:
- If
cameraOnistrue, the camera is turned on and the video captured by the camera is transmitted. - If
cameraOnisfalse, the camera remains turned off and video is not transmitted.
Note
- The default value of
cameraOnfor both the call start API and the video call switching API istrue. - If you set
cameraOntofalse, the local user's video is not transmitted. To capture and transmit the local user's video, you must callresumeMyVideo()afterward. - In versions prior to WebPlanetKit 5.2, the
cameraOnfeature was provided under the namevideoEnabled.
Setting the initial video state at the start of a video call
You can set the initial video state by adding cameraOn to MakeCallParams, VerifyCallParams, or ConferenceParams.
-
1-to-1 call
// Caller side
const makeCallParams = {
...,
cameraOn: false
};
planetKit.makeCall(makeCallParams);// Callee side
const verifyCallParams = {
...,
cameraOn: false
};
planetKit.verifyCall(verifyCallParams); -
Group call
const conferenceParams = {
...,
cameraOn: false
};
planetKit.joinConference(conferenceParams);
Setting the initial video state for switching to a video call
When enabling a video call in a 1-to-1 or group call, you can set the initial video state by adding cameraOn to EnableVideoOptions of enableVideo(). For more information, see Enabling a video call from an audio call.