setCameraTorchOn abstract method

Future<void> setCameraTorchOn(
  1. bool isOn
)

Sets whether to turn on the flashlight.

This method is applicable to Android and iOS only. You must call this method after enableVideo. The setting takes effect after the camera is successfully turned on, i.e., after the SDK triggers the onLocalVideoStateChanged callback and the local video state is localVideoStreamStateCapturing (1).

  • isOn Whether to turn on the flashlight: true : Turn on the flashlight. false : (default) Turn off the flashlight.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.

Implementation

Future<void> setCameraTorchOn(bool isOn);