KevinnZou / compose-webview-multiplatform

WebView for JetBrains Compose Multiplatform
https://kevinnzou.github.io/compose-webview-multiplatform/
Apache License 2.0
305 stars 39 forks source link

Kotlin getCameraCharacteristics error #109

Closed direstrepo24 closed 1 month ago

direstrepo24 commented 2 months ago

Hi. When I place the webview inside a screen and start scrolling down, this error occurs (version 1.8.8, android api 34):

2024-02-27 15:22:24.833 23518-23622 cr_VideoCapture com.conexiondevida.org E getCameraCharacteristics: java.lang.IllegalArgumentException: getCameraCharacteristics:851: Unable to retrieve camera characteristics for unknown device 0: No such file or directory (-2) at android.hardware.camera2.CameraManager.throwAsPublicException(CameraManager.java:1625) at android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:671) at android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:612) at WV.bY.m(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:15) at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:1) at org.chromium.media.VideoCaptureFactory.isZoomSupported(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:1) Caused by: android.os.ServiceSpecificException: getCameraCharacteristics:851: Unable to retrieve camera characteristics for unknown device 0: No such file or directory (-2) (code 3) at android.os.Parcel.createExceptionOrNull(Parcel.java:3071) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at android.hardware.ICameraService$Stub$Proxy.getCameraCharacteristics(ICameraService.java:805) at android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:650) at android.hardware.camera2.CameraManager.getCameraCharacteristics(CameraManager.java:612)  at WV.bY.m(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:15)  at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:1)  at org.chromium.media.VideoCaptureFactory.isZoomSupported(chromium-TrichromeWebViewGoogle6432.aab-stable-616717833:1) 

KevinnZou commented 2 months ago

@direstrepo24 Could you provide the test URL? Did you test this URL with raw Android Webview?

direstrepo24 commented 2 months ago

Hello, of course the url is: https://open.spotify.com/embed/episode/21AaFC5v1e8CYRoGxKKh1s?utm_source==oembed and and also youtube videos, example `LazyColumn( modifier = Modifier .fillMaxSize() .padding(16.dp), horizontalAlignment = Alignment.CenterHorizontally ) {

item { Text( "4. Alaba a Dios", textAlign = TextAlign.Center, modifier = Modifier.width(150.dp), fontWeight = FontWeight.Bold ) Spacer(modifier = Modifier.height(12.dp)) //aqui va el webview WebView( state = youtubeWebViewState, modifier = Modifier .fillMaxWidth() .aspectRatio(16 / 9f) // Asumiendo un aspect ratio de 16:9 para el video. .height(400.dp) ) Spacer(modifier = Modifier.height(8.dp)) }`

KevinnZou commented 2 months ago

@direstrepo24 I have tested the URL and YouTube videos on my device and they are all working well. Based on the stacktrace, it appears to be a problem with your device. Have you tried testing it on other devices? They work well on both my device and simulator.