opentok-react-native icon indicating copy to clipboard operation
opentok-react-native copied to clipboard

Feature Request: Ability to turn on flashlight

Open DGeoWils opened this issue 4 years ago • 3 comments

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!

DGeoWils avatar Jun 10 '20 19:06 DGeoWils

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 :)

msach22 avatar Jun 10 '20 20:06 msach22

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 avatar Sep 17 '20 18:09 cantayma

@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).

t4ngth00 avatar Sep 28 '20 22:09 t4ngth00

This is not functionality in the OpenTok client SDKs.

jeffswartz avatar Jul 27 '23 05:07 jeffswartz