CameraX Back and front camera can't preview at same time ?
See original GitHub issuepreviewBack.setSurfaceProvider(viewBack.surfaceProvider)
previewFront.setSurfaceProvider(viewFront.surfaceProvider)
val cameraBack = cameraProvider.bindToLifecycle(this, cameraSelectorBack, previewBack)
val cameraFront = cameraProvider.bindToLifecycle(this, cameraSelectorFront, previewFront)
java.lang.IllegalArgumentException: Multiple LifecycleCameras with use cases are registered to the same LifecycleOwner.
at androidx.camera.lifecycle.LifecycleCameraRepository.bindToLifecycleCamera(LifecycleCameraRepository.java:269)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:423)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:274)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
android camerax - Camera X - Accessing both Front and Back ...
Upon home press and launching app again, either one of the preview (Back or Front) shows up and there is no pattern found....
Read more >Open Both Front And Back Cameras Simultaneously
You see, our devices have proximity sensors and when we detect a user's presence, we turn on the cameras and show the preview...
Read more >Can We Use the Front & Back Cameras at the Same Time on ...
TL;DR: Yes, if the device's software and hardware support it, which can't be taken for granted. Currently, the only way how to query...
Read more >CameraX preview only show black view on Samsun S8 ...
As the document states, LIMITED-level camera (front camera of S8) are not guaranteed to support MAXIMUM/YUV and other streams at the same time....
Read more >How to Use the Front and Rear Camera Previews ...
Set Up Views for Preview We will require two separate views to present the preview from two cameras. We will start small by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hii guy’s use - cameraProvider.unbindAll() // Unbind use cases before rebinding,
btnSwitchCamera.setOnClickListener {
@agent10 haha i expected an camerax but camera2 fair enough. Did u share source in github? I really want to take a look