Start a conversation

Switch the camera for video call (Android)

How can I switch the camera?

The camera can be switched during a video call. To implement this option use:

cameraView.switchCamera();

For example,locate "Switch" button over cameraView in xml file:

android:id="@+id/switchBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

And in java.file apply clickListener for created button:

switchCameraBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) { cameraView.switchCamera(); }
});

Now users can switch camera during the video call.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Maksym Pidhorbunskyi

  2. Posted

Comments