I don't know a plugin that implements it. But you can easily extend the lamp plugin.
You could extend the interface ILamp like
public interface ILamp
{
///....
void TurnOn(float intensity);
}
then implement it by copying the TurnOn
functionality
iOS
public void TurnOn(float intensity)
{
var captureDevice = AVCaptureDevice.DefaultDeviceWithMediaType(AVMediaType.Video);
if (captureDevice == null)
{
Debug.WriteLine("No captureDevice - this won't work on the simulator, try a physical device");
return;
}
NSError error = null;
captureDevice.LockForConfiguration(out error);
if (error != null)
{
Debug.WriteLine(error);
captureDevice.UnlockForConfiguration();
return;
}
else
{
if (captureDevice.TorchMode != AVCaptureTorchMode.On)
{
captureDevice.TorchMode = AVCaptureTorchMode.On;
NSError err;
captureDevice.SetTorchModeLevel(intensity, out err); // add this line
}
captureDevice.UnlockForConfiguration();
}
}
On Android I'm not sure if there is a API to control it. I can't find one. If there is one, just proceed like on iOS.
If the platform has no API, just implement TurnOn(float intensity)
like
public void TurnOn(float intensity)
{
TurnOn();
}