Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
911 stars 200 forks source link

Flash doesn't work on Android #338

Open aggeloskoutanis opened 1 year ago

aggeloskoutanis commented 1 year ago

Steps to Reproduce

I am using the AwesomeFlashButton in order to let the user before starting a video recording. When the user selects FlashMode.on or FlashMode.auto and starts the video recording, the flash it's never turned off. The only thing that works it's FlashMode.always.

Expected results

The flash should be turned on while video recording and FlashMode is FlashMode.on. Or the flash should be turned on while video recording and FlashMode is FlashMode.auto and the room light is low.

Actual results

When FlashMode.on or FlashMode.auto, the Flashlight won't turn on.

About your device

Brand Model OS
Google Pixel 4a (5G) 13
Apple 12 iOS 16.3.1

Your flutter version

Flutter 3.7.12 • channel stable • https://github.com/flutter/flutter.git Framework • revision 4d9e56e694 (3 weeks ago) • 2023-04-17 21:47:46 -0400 Engine • revision 1a65d409c7 Tools • Dart 2.19.6 • DevTools 2.20.1

apalala-dev commented 1 year ago

We are relying on CameraX for the Android part and unfortunately there is no flash mode for video recordings. The only thing we can do is enable or not the flash in torch mode, which explains your behaviour.

@istornz It it the same behaviour on iOS?

aggeloskoutanis commented 1 year ago

Thanks a lot for the fast reply. I just tried it on an iPhone 12 with iOS 16.3.1 and I'm facing the same issue.

apalala-dev commented 1 year ago

I suspect it's the default behaviour for video recording: either you set torch mode or you don't. That's at least the behaviour on the default camera app of my Android phone (Xiaomi Mi 9T, running MIUI with Android 11).