setTorchEnabled

open override fun setTorchEnabled(enable: Boolean, torchChangedResultListener: (isSuccessful: Boolean) -> Unit?)

Requests the camera to change the torch state. If the camera does not have a torch unit then the torch change will fail.

Parameters

enable

The desired state of the torch. True for on, False for off.

torchChangedResultListener

An optional listener to receive the result of the torch change.