Help Center/ Meeting/ Client SDK Reference/ Android SDK/ API Reference/ Basic Settings/ Enabling or Disabling the Camera and Microphone in a Meeting
Updated on 2024-07-30 GMT+08:00

Enabling or Disabling the Camera and Microphone in a Meeting

You can configure whether to automatically enable the camera or microphone when joining a meeting in OpenSDKConfig.

When you join a meeting, the SDK uses this callback API to obtain whether the camera and microphone are enabled and configure whether to enable the camera and microphone.

Application Scenarios

Users can enable or disable the camera and microphone in the application settings. You can customize this callback API to ensure that the status of the camera and microphone is the same as that configured by users in the application settings when the users join a meeting.

Precautions

1. The application must have the permission to enable the camera. Otherwise, the camera cannot be enabled.

2. sdkConfig takes effect only when this configuration is passed during SDK initialization.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
public class MyDeviceStrategyWhenConfAccept implements IDeviceStrategyWhenConfAccept {
    @Override
    public boolean isTurnOnCameraWhenConfAccept() {
        // Specify whether to turn on or off the camera.
        return false;
    }

    @Override
    public boolean isTurnOnMicWhenConfAccept() {
        // Specify whether to turn on or off the microphone.
        return false;
    }
}
sdkConfig.setDeviceStrategyWhenConfAccept(new MyDeviceStrategyWhenConfAccept());