enableCamera method

Future<void> enableCamera(
  1. bool enable,
  2. {ZegoPublishChannel? channel}
)

Turns on/off the camera (for the specified channel).

Available since: 1.1.0 Description: This function is used to control whether to start the capture of the camera. After the camera is turned off, the video capture will not be performed. At this time, there will be no video data for local preview and push streaming. Default value: The default is true which means the camera is turned on. When to call: After creating the engine createEngine. Restrictions: None. Caution: In the case of using the custom video capture function enableCustomVideoCapture, since the developer has taken over the video data capture, the SDK is no longer responsible for the video data capture, but this function still affects whether to encode or not. Therefore, when developers use custom video capture, please ensure that the value of this function is true. Note: This function is only available in ZegoExpressVideo SDK!

  • enable Whether to turn on the camera, true: turn on camera, false: turn off camera
  • channel Publishing stream channel

Implementation

Future<void> enableCamera(bool enable, {ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .enableCamera(enable, channel: channel);
}