Skip to main content
Version: 6.0

Enabling video call

You can switch to a video call during an audio call ("enable a video call") or switch back to an audio call during a video call ("disable a video call").

The process of making a request for enabling a video call can vary depending on the call type. This page describes how to enable or disable a video call based on the call type.

Supported call typeMinimum SDK version
1-to-1 call, group call (conference)WebPlanetKit 3.1

1-to-1 call

To enable or disable a video call in 1-to-1 calls, use the following methods of Call.

MethodDescriptionRelated event callbacks
enableVideo()Makes a request for enabling a video call.evtVideoEnabledByPeerAndMyVideoPaused
disableVideo()Makes a request for disabling a video call. evtVideoDisabledByPeer

Initial video state of the requester

You can set the initial video state by adding a boolean type cameraOn as an argument to EnableVideoOptions of enableVideo(). 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 is true.
  • If you set cameraOn to false, the requestor's video is not transmitted. To capture and transmit the requestor's video, you must call resumeMyVideo() of Call afterward.
  • In versions prior to WebPlanetKit 5.2, the cameraOn feature was provided under the name videoEnabled.

Enabling a video call

When the requester calls enableVideo(), a video call is enabled with the request receiver's video in a paused state. To start sending the video, the request receiver must call resumeMyVideo().

Note

Since WebPlanetKit 6.0, the function to set the response type (pausing the video or sending the video) in 1-to-1 calls has been deprecated and the request receiver's video becomes paused when a video call is enabled.

1-to-1 call enable video sequence diagram

For more information on evtPeerVideoPaused and evtPeerVideoResumed, refer to Video pause event.

Disabling a video call

To stop video streaming during a video call, call disableVideo().

Note

Unlike native PlanetKit, WebPlanetKit does not support passing disableReason when calling disableVideo() in 1-to-1 calls.

1-to-1 call disable video sequence diagram

Flow example for the decline case

If the receiver of the enableVideo() request does not wish to participate in a video call, the user can decline the video call. In this case, the call procedure should be as follows:

1-to-1 call decline video enable sequence diagram

Group call

To enable or disable a video call in group calls, use the following methods of Conference.

MethodDescriptionRelated event callbacks
enableVideo()Makes a request for enabling a video call.evtPeersVideoUpdated
(state=ENABLED)
disableVideo()Makes a request for disabling a video call.evtPeersVideoUpdated
(state=DISABLED)

There are three states delivered by evtPeersVideoUpdated: ENABLED, DISABLED, and PAUSED.

If the state is PAUSED, you must take necessary actions by referring to pauseReason. For more information, refer to Video pause event.

Initial video state of the requester

You can set the initial video state by adding a boolean type cameraOn as an argument to EnableVideoOptions of enableVideo(). 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 is true.
  • If you set cameraOn to false, the requestor's video is not transmitted. To capture and transmit the requestor's video, you must call resumeMyVideo() of Conference afterward.
  • In versions prior to WebPlanetKit 5.2, the cameraOn feature was provided under the name videoEnabled.

Enabling a video call

After the requester calls enableVideo(), each of other participants must decide whether to receive the stream or not by calling requestPeerVideo().

Group call enable video sequence diagram

Disabling a video call

To stop video streaming during a group video call, call disableVideo().

Group call disable video sequence diagram

APIs related to enabling and disabling a video call are as follows.

Common

1-to-1 call

Methods

Events

Group call

Methods

Events