Kasem Mohamed
Committed by GitHub

Fix NoSuchMethodError when calling CameraXHelper.createCameraProvider without useCases (#546)

* Fix NoSuchMethodError No virtual method createCameraProvider caused by method kotlin optional argument

* Fix typo in readme

* Use JvmOverloads
... ... @@ -55,14 +55,14 @@ We provide a convenience `ScaleZoomHelper` class that can handle pinch-to-zoom f
### Taking a high quality picture
This allows you to take a high picture without interrupting the video stream.
This allows you to take a picture without interrupting the video stream.
```
// Pass in the imageCapture use case when creating the camera provider
val imageCapture = ImageCapture.Builder()
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
.build()
CameraXHelper.createCameraProvider(lifecycleOwner, arrayOf(imageCapture).let {
CameraXHelper.createCameraProvider(lifecycleOwner, arrayOf(imageCapture)).let {
if (it.isSupported(application)) {
CameraCapturerUtils.registerCameraProvider(it)
... ...
... ... @@ -29,7 +29,6 @@ import io.livekit.android.room.track.video.CameraEventsDispatchHandler
class CameraXHelper {
companion object {
/**
* Creates a CameraProvider that uses CameraX for its sessions.
*
... ... @@ -40,6 +39,7 @@ class CameraXHelper {
* @param lifecycleOwner The lifecycleOwner which controls the lifecycle transitions of the use cases.
* @param useCases The use cases to bind to a lifecycle.
*/
@JvmOverloads
@ExperimentalCamera2Interop
fun createCameraProvider(
lifecycleOwner: LifecycleOwner,
... ...