react-native-vision-camera icon indicating copy to clipboard operation
react-native-vision-camera copied to clipboard

feat: support for the torch control and returns torch timestamps on `onRecordingFinished` callback.

Open robert-go opened this issue 3 years ago • 3 comments

What

This PR adds support for the torch and returns torch timestamps on onRecordingFinished callback.

Changes

This PR added new props metadata to capture torch timestamps data on onRecordingFinished callback and adds a new props torchControl

torchControl={{ torchDuration: 5, torchDelay: 2 }}

Tested on

  • iPhone 11 Pro, iOS 15
  • iPhone 12, iOS 15
  • iPhone 13 Pro Max, iOS 15

Related issues

nope

robert-go avatar Jul 29 '22 10:07 robert-go

Hi, thanks for your PR! This looks very interesting, although the API is a bit weird and looks very hardcoded. Is there a way to also get that behaviour on android? Can we alternatively maybe have an imperative API? Why can't the user just set state to toggle torch on or off and does all the timing logic in JS?

mrousavy avatar Jul 29 '22 14:07 mrousavy

  • We don't have that behavior on android yet.
  • Yes, we can make an imperative API for that functionality.
  • about using the state to toggle, actually, we did, we also measured the time start recording call and the time starts recording actually do their action. we think to pass a prop to control the torch and let start recording functions using it for a better approach for our case.

robert-go avatar Aug 01 '22 03:08 robert-go

@mrousavy Could you please approve running workflows?

robert-go avatar Aug 02 '22 02:08 robert-go

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ❌ Failed (Inspect) Aug 28, 2023 6:05am

vercel[bot] avatar Mar 07 '23 03:03 vercel[bot]

Hey thanks for your PR and sorry for the long radio silence. sorry but I don't think the internal state makes sense here.

mrousavy avatar Sep 30 '23 13:09 mrousavy