fix: Close CameraSession if the View is removed (#2174)

* fix: Close `CameraSession` if the View is removed

* fix: Use ViewManager's `onDropViewInstance` instead

* fix: Only stop repeating if we have a session

* fix: Reset `configuration` on `close()`
This commit is contained in:
Marc Rousavy
2023-11-18 14:58:07 +01:00
committed by GitHub
parent 98a641702c
commit a7e706150e
3 changed files with 14 additions and 4 deletions

View File

@@ -31,6 +31,11 @@ class CameraViewManager : ViewGroupManager<CameraView>() {
override fun getName(): String = TAG
override fun onDropViewInstance(view: CameraView) {
view.destroy()
super.onDropViewInstance(view)
}
@ReactProp(name = "cameraId")
fun setCameraId(view: CameraView, cameraId: String) {
view.cameraId = cameraId