toggleCamera method

Future<void> toggleCamera()

Function to toggle enable/disable the camera

Implementation

Future<void> toggleCamera() async {
  var status = await Permission.camera.status;
  if (value.isLocalVideoDisabled && status.isDenied) {
    await Permission.camera.request();
  }
  value = value.copyWith(isLocalVideoDisabled: !(value.isLocalVideoDisabled));
  await value.engine?.muteLocalVideoStream(value.isLocalVideoDisabled);
}