@capgo/camera-preview 7.13.4 → 7.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -765,10 +765,13 @@ public class CameraXView implements LifecycleOwner, LifecycleObserver {
765
765
  videoCapture = VideoCapture.withOutput(recorder);
766
766
  }
767
767
 
768
- preview.setSurfaceProvider(previewView.getSurfaceProvider());
769
768
  // Unbind any existing use cases and bind new ones
770
769
  cameraProvider.unbindAll();
771
770
 
771
+ // Re-set the surface provider after unbinding to ensure the preview
772
+ // is connected and video frames are captured correctly
773
+ preview.setSurfaceProvider(previewView.getSurfaceProvider());
774
+
772
775
  // Bind with or without video capture based on enableVideoMode
773
776
  if (sessionConfig.isVideoModeEnabled() && videoCapture != null) {
774
777
  camera = cameraProvider.bindToLifecycle(
@@ -3854,6 +3857,10 @@ public class CameraXView implements LifecycleOwner, LifecycleObserver {
3854
3857
  // Rebind with video capture included
3855
3858
  cameraProvider.unbindAll();
3856
3859
  if (preview != null) {
3860
+ // CRITICAL: Re-set the surface provider after unbinding
3861
+ // Without this, the preview won't be connected to the surface and video won't be captured
3862
+ preview.setSurfaceProvider(previewView.getSurfaceProvider());
3863
+
3857
3864
  camera = cameraProvider.bindToLifecycle(
3858
3865
  this,
3859
3866
  currentCameraSelector,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/camera-preview",
3
- "version": "7.13.4",
3
+ "version": "7.13.5",
4
4
  "description": "Camera preview",
5
5
  "license": "MIT",
6
6
  "repository": {