Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] CameraView IsTorchOn not working on Android

Open jfversluis opened this issue 1 year ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

  • [X] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

Current Behavior

Setting the IsTorchOn to true does not have any effect at least on Android. I have been testing Android 12, on a physical Samsung Galaxy S10e. Didn't test any other platforms yet.

Expected Behavior

The flashlight turns on and can be used as a torch

Steps To Reproduce

  1. Add CameraView to your project
  2. Set IsTorchOn in XAML to true
  3. Alternatively set IsTorchOn to true from code
  4. In both cases it does not have any effect when deployed to the device

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui

Environment

- .NET MAUI CommunityToolkit Camera: 1.0.2
- OS: Android 12
- .NET MAUI: 8.0.61

Anything else?

No response

jfversluis avatar Jul 02 '24 10:07 jfversluis

As mentioned in https://github.com/CommunityToolkit/Maui/pull/1758, the foundation of this PR is based on https://github.com/CommunityToolkit/Maui/pull/1080, where IsTorchOn was initially added. However, this property has not actually been implemented in any of the supported platforms yet, therefore setting it would have no effect. This is reflected in CameraViewHandler where no PropertyMapper for IsTorchOn is defined.

On a side note, the same situation applies to IsCameraBusy as well, where it doesn't actually reflect the status of the CameraView.

zhitaop avatar Jul 03 '24 01:07 zhitaop

Oooh thanks! I missed that. Yeah so lets make sure to implement those then I guess 😄

jfversluis avatar Jul 03 '24 12:07 jfversluis

Flash on/auto And it won't work.

CodingOctocat avatar Jul 07 '24 02:07 CodingOctocat

@jfversluis No worries and thanks for catching this! I completely forgot about these unimplemented features in the PR and just let them sneak in to the release... I guess the maintainer team can decide if we should temporarily remove them in a new release until they are properly implemented?

zhitaop avatar Jul 08 '24 23:07 zhitaop

Any progress for Handler mapping?

MarMarIV avatar Mar 03 '25 05:03 MarMarIV