NativeScript / mlkit

Apache License 2.0
24 stars 9 forks source link

Android and iOS: torchOn parameter does not adequately initialize MlKitView #17

Closed cjohn001 closed 2 years ago

cjohn001 commented 2 years ago

I would expect that if I bind a boolean to the torchOn parameter of the MlKitView where torchOn is set to true initially, that the torch then gets enabled when the video stream starts.

Example here: https://github.com/cjohn001/mlkit-test/blob/2d05bd4ce3e1853ba8c54b69ac5edb053f4c32d9/src/app/item/items.component.ts#L19

Unfortunately, the state of torchOn is not reflected by the MlKitView, The initially state when set to true has not the expected effect. Setting the parameter only has an effect after the video stream was started. I assume the right way would be that the plugin checks the torchOn state after activating the video stream and depending on state also activates the torch.