PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.4k stars 759 forks source link

Why this library want access to device camera and bluethooth permissions? #1091

Open sunbyte opened 9 months ago

sunbyte commented 9 months ago

When a video is played I got this in Logcat

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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15) at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1) at org.chromium.media.VideoCaptureFactory.getDeviceName(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637: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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15)  at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  at org.chromium.media.VideoCaptureFactory.getDeviceName(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  2023-12-08 16:27:26.082 18878-19015 cr_VideoCapture com.todoboom.app 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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15) at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1) at org.chromium.media.VideoCaptureFactory.getDeviceId(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637: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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15)  at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  at org.chromium.media.VideoCaptureFactory.getDeviceId(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  2023-12-08 16:27:26.093 18878-19015 cr_VideoCapture com.todoboom.app 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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15) at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1) at org.chromium.media.VideoCaptureFactory.getCaptureApiType(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637: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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15)  at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  at org.chromium.media.VideoCaptureFactory.getCaptureApiType(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1)  2023-12-08 16:27:26.122 18878-19015 cr_VideoCapture com.todoboom.app 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 Dw0.i(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:15) at org.chromium.media.VideoCaptureFactory.isLegacyOrDeprecatedDevice(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:1) at org.chromium.media.VideoCaptureFactory.getFacingMode(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637: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)

PierfrancescoSoffritti commented 9 months ago

I don't think this error comes from the library. Why do you think that?

sunbyte commented 9 months ago

Because this is happening when the library try to load and play video. If I remove the library I don't have this problem. In our application we do not use camera or camera permissions.

PierfrancescoSoffritti commented 9 months ago

The library doesn't require access to camera or bluetooth either.

billdizl commented 9 months ago

yes ,The library doesn't require access to camera or bluetooth either. This library is equivalent to webview, this webview may load youtube link,so doesn't require access to camera or bluetooth either.

sunbyte commented 9 months ago

This library TRY to access camera information and bluetooth when a video is loaded. You can see it very easy in the logcat. Maybe your library use another library that do this actions.

billdizl commented 9 months ago

Please check your code,If you still think it's a problem with the library,You can do this, have 3 ways to test and verify

  1. you close all app for your mobile ,Run your app and check if logcat has the log
  2. Run the demo of the library to check if the issue exists
  3. Replace the phone and try again with 1 and 2 above. If they still exist, provide feedback again
    @sunbyte
PierfrancescoSoffritti commented 9 months ago

Let us know if you see the same log from the sample app.