feat: Add onStarted and onStopped events (#2273)

* feat: Add `onStarted` and `onStopped` events

* Implement `onStart` for Android

* Update CameraSession.kt

* Update CameraSessionDelegate.swift
This commit is contained in:
Marc Rousavy
2023-12-09 21:09:55 +03:00
committed by GitHub
parent 9ef4a9a210
commit 4ee52d6211
12 changed files with 105 additions and 11 deletions

View File

@@ -246,9 +246,17 @@ export interface CameraProps extends ViewProps {
*/
onError?: (error: CameraRuntimeError) => void
/**
* Called when the camera was successfully initialized.
* Called when the camera session was successfully initialized. This will get called everytime a new device is set.
*/
onInitialized?: () => void
/**
* Called when the camera started the session (`isActive={true}`)
*/
onStarted?: () => void
/**
* Called when the camera stopped the session (`isActive={false}`)
*/
onStopped?: () => void
/**
* A worklet which will be called for every frame the Camera "sees".
*