Forum Xamarin Cross Platform with Xamarin

How to make the flash light auto activate when the camera was activate?

Hello, How to make the flash light auto activate when the camera was activate?

I include the flash light function but the camera cannot working well, so how to make it this two function carry simultaneously?
Below is my code, can anyone share me ideas?

            CrossMedia.Current.Initialize();
            if (!CrossMedia.Current.IsTakePhotoSupported && !CrossMedia.Current.IsTakeVideoSupported)
            {
                DisplayAlert("Message", "Photo Capture and Pick Not supported", "ok");
                return;
            }
            else
            {

                CrossLamp.Current.TurnOn();

                var file = CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                {
                    //DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Front,
                    CompressionQuality = 92,
                    SaveToAlbum = true,
                    Directory = "Image",
                    Name = DateTime.Now + "_test.jpg"
                });
Sign In or Register to comment.