opentok-react-native
opentok-react-native copied to clipboard
Feature Request: Ability to turn on flashlight
Feature Request
Description
Currently our use case sometimes encounters lower light situations (basements/closets) and the ability to turn on the torch (flashlight) on the phone would be extremely helpful. I have been able to turn on the light on iOS separately, but the nature of the camera service on Android is disallowing me from taking the same action.
Proposal
A method or prop exposed on the OTPublisher component that will turn on the flashlight.
Either
this.refs.publisherComponent.setFlashlight(<boolean>)
or
<OTPublisher properties={{torchOn: <boolean>}} />
Thank you!
Thanks for filing the feature request, please note that this is not an officially supported library, but we'll do our best to prioritize this to complete on our free times :)
Hello, is there any progress on this enhancement? This is a pretty time intensive blocker for our team at the moment. We would love to implement it with the OTPublisher to avoid some pretty nasty bridge code. Much appreciated!
@cantayma I have done that flashlight toggle feature on our private project for both iOS and Android by using custom VideoCapturer with native codes and React native bridge methods. As stated that is not officially supported library, I suggest your team should fork this library and implement your own CustomVideoCapturer for both iOS and Android. By doing that, not only you can easily customize your application features but also fix some current issues with camera on Android (camera autofocus issue in DefaultVideoCapturer and camera switching issue in Camera2VideoCapturer - I'm not sure those happens for all the android devices/ OS versions but at least those happen in my Oneplus 7T + Android 10).
This is not functionality in the OpenTok client SDKs.