Skip to content

Commit 2237525

Browse files
authored
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
1 parent 911cfb3 commit 2237525

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

livekit-android-camerax/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ We provide a convenience `ScaleZoomHelper` class that can handle pinch-to-zoom f
5555

5656
### Taking a high quality picture
5757

58-
This allows you to take a high picture without interrupting the video stream.
58+
This allows you to take a picture without interrupting the video stream.
5959

6060
```
6161
// Pass in the imageCapture use case when creating the camera provider
6262
val imageCapture = ImageCapture.Builder()
6363
.setCaptureMode(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
6464
.build()
65-
CameraXHelper.createCameraProvider(lifecycleOwner, arrayOf(imageCapture).let {
65+
CameraXHelper.createCameraProvider(lifecycleOwner, arrayOf(imageCapture)).let {
6666
if (it.isSupported(application)) {
6767
CameraCapturerUtils.registerCameraProvider(it)
6868

livekit-android-camerax/src/main/java/livekit/org/webrtc/CameraXHelper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import io.livekit.android.room.track.video.CameraEventsDispatchHandler
2929

3030
class CameraXHelper {
3131
companion object {
32-
3332
/**
3433
* Creates a CameraProvider that uses CameraX for its sessions.
3534
*
@@ -40,6 +39,7 @@ class CameraXHelper {
4039
* @param lifecycleOwner The lifecycleOwner which controls the lifecycle transitions of the use cases.
4140
* @param useCases The use cases to bind to a lifecycle.
4241
*/
42+
@JvmOverloads
4343
@ExperimentalCamera2Interop
4444
fun createCameraProvider(
4545
lifecycleOwner: LifecycleOwner,

0 commit comments

Comments
 (0)