This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

fix: Camera frozen when coming back from background

author
Nuria
committer
Tangled
date (Oct 15, 2025, 12:07 PM UTC) commit d0f51073 parent a82cc15c
+7 -1
+2 -1
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraEngine.kt
··· 10 10 import androidx.compose.ui.graphics.toComposeImageBitmap 11 11 import androidx.compose.ui.unit.Density 12 12 import androidx.compose.ui.unit.LayoutDirection 13 + import co.touchlab.kermit.Logger 13 14 import com.performancecoachlab.posedetection.custom.CustomObjectRespository 14 15 import com.performancecoachlab.posedetection.custom.ObjectModel 15 16 import com.performancecoachlab.posedetection.recording.AnalysisObject ··· 214 215 cameraController.switchCamera() 215 216 } 216 217 217 - private fun startSession() { 218 + fun startSession() { 218 219 MemoryManager.clearBufferPools() 219 220 cameraController.startSession() 220 221 }
+5
posedetection/src/iosMain/kotlin/com/performancecoachlab/posedetection/camera/CameraPreview.kt
··· 21 21 CameraEngine() 22 22 } 23 23 LifecycleEventEffect(Lifecycle.Event.ON_STOP) { 24 + // Stops camera when going to background 24 25 cameraEngine.stopSession() 26 + } 27 + LifecycleEventEffect(Lifecycle.Event.ON_RESUME) { 28 + // Resumes the camera when coming back from background 29 + cameraEngine.startSession() 25 30 } 26 31 27 32 LaunchedEffect(cameraEngine) {