Skip to main content
Version: 5.3

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 typeMinimum 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 cameraOn is true, the camera is turned on and the video captured by the camera is transmitted.
  • If cameraOn is false, the camera remains turned off and video is not transmitted.
Note
  • The default value of cameraOn for both the call start API and the video call switching API is true.
  • If you set cameraOn to false, the local user's video is not transmitted. To capture and transmit the local user's video, you must call resumeMyVideo() afterward.
  • In versions prior to WebPlanetKit 5.2, the cameraOn feature was provided under the name videoEnabled.

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.