You can switch to a video call in the middle of 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 and how peers respond to the request can vary depending on the call type. This page describes how to enable or disable a video call based on the call type.
The initialMyVideoState parameter of enableVideo() determines the initial video state of the requester. The value of the parameter can be one of the following, which are defined in the PlanetKitInitialMyVideoState enum:
resume: The camera is turned on and the video captured by the camera is transmitted.
pause: The camera remains turned off and video is not transmitted.
Note
The default value of the initialMyVideoState parameter is resume.
If you set the parameter to pause, the requester's video is not transmitted. To capture and transmit the requester's video, you must call resumeMyVideo() of PlanetKitCall afterward.
The video call requester always sends their video stream, but two scenarios are available on the receiver side. The scenario is selected by the value of the response type.
Scenario 1: Manually respond with video streaming
The response type of the receiver is pause.
In this scenario, a video call is started in a paused status.
The receiver of the video call request (Client 02) can choose when to send their video stream.
Client 02 (Android/iOS PlanetKit) switches the audio playback medium to speakerphone if no external device is connected.
For more information on onPeerVideoPaused and onPeerVideoResumed, refer to Video pause event.
Scenario 2: Automatically respond with video streaming
The response type of the receiver is send.
The receiver of the video call request (Client 02) sends their stream when the request arrives.
Client 02 (Android/iOS PlanetKit) switches the audio playback medium to speakerphone if no external device is connected.
Tip
It is recommended to select the receiver's scenario and set it up in advance. In other words, set the response type value to a constant such as pause or send.
If the receiver of the enableVideo() request does not wish to participate in a video call, the user can decline the video call. It is assumed that the response type is pause. In this case, the call procedure should be as follows:
If a client receives the onVideoEnabledByPeer event but fails to open the camera, the client must call resumeMyVideo() after successfully reopening its camera device.
The initialMyVideoState parameter of enableVideo() determines the initial video state of the requester. The value of the parameter can be one of the following, which are defined in the PlanetKitInitialMyVideoState enum:
resume: The camera is turned on and the video captured by the camera is transmitted.
pause: The camera remains turned off and video is not transmitted.
Note
The default value of the initialMyVideoState parameter is resume.
If you set the parameter to pause, the requester's video is not transmitted. To capture and transmit the requester's video, you must call resumeMyVideo() of PlanetKitConference afterward.
After the requester calls enableVideo(), each of other participants must decide whether to receive the stream or not by calling startVideo() of PlanetKitPeerControl.