0

https://www.webrtc-experiment.com/demos/MediaStreamTrack.getSources.html

I was on the webrtc sample page in the select input and the above webpage.

I only see front facing and back camera in the options.

I do not the see the c920 usbcam connect to my smartphone via otg usb.

The same site work fine when visiting on my desktop computer connection c920

Can webrtc not select my usbcam as a source ?

I thought it would show up as id 2 and as a third option?

Can not find any code that show how this is done.

kristoph
  • 101
  • 2
  • 13
  • Android != DesktopOS Native webcam support via USB port on Android devices is optional: https://source.android.com/devices/camera/external-usb-cameras Browser can't find what the Android framework doesn't show. See: https://stackoverflow.com/search?q=%5Bandroid%5D+usb+webcam – Morrison Chang Nov 20 '20 at 06:41
  • @MorrisonChang oh wow thanks that makes sense. Is there any way to show it using nodejs app. I want to avoid developing an android app but is that the only way? How about webusb api? or WebAssembly? To bad webrtc and android are not enabling it. Would be great for streaming on mobile. – kristoph Nov 20 '20 at 08:16
  • Unless the device has Android framework code for supporting USB camera, your only option is to write a native Java/Kotlin Android app with C/C++ libraries to connect and process the USB camera. Any in-browser API is dependent on what the rest of the system is providing which explains why built-in front and rear camera works. – Morrison Chang Nov 20 '20 at 16:11
  • @MorrisonChang. Perhaps using webusb it's possible ? This links suggest uvc usb should work with Android without changing any settings https://developers.google.com/web/fundamentals/native-hardware/build-for-webusb – kristoph Nov 21 '20 at 18:31
  • You don't mention which device/OS version you are testing on. Related thread: [How to get picture from a camera in browser using WEB USB API](https://stackoverflow.com/q/63775442/295004) – Morrison Chang Nov 21 '20 at 19:23
  • @MorrisonChang Android 9 – kristoph Nov 22 '20 at 23:04
  • I asked for device as well, as others with your particular hardware may have encountered the problem. As while Android 9 does have support the fact that the [Android 9 Compatibility Definition Document states that External Camera is Optional](https://source.android.com/compatibility/9/android-9-cdd#7_5_3_external_camera) means that not every manufacturer enabled the feature. – Morrison Chang Nov 22 '20 at 23:15
  • Redmi Note 5. sorry missed that @MorrisonChang Ya looks like making an apk is the only way. I twoul dbe nice for android to allow users to enable it in settings. – kristoph Nov 23 '20 at 04:08
  • @MorrisonChang went and got the pixel 5, it runs android 11 . still webrtc sample demo doesnt work. – kristoph Nov 26 '20 at 21:33
  • It is unclear if Pixel devices enabled support for UVC webcam (external usb camera) as part of the native Android Framework. Visiting https://www.webrtc-experiment.com/DetectRTC/ with Pixel 2 Android 10 with USB-to-go connector to a c920, both Chrome Android (v87) and Firefox (v83) DO NOT see the c920. Same webrtc site, Galaxy S9 Android 10, Chrome Android (v87) and Firefox (v83) DO see the c920. My guess is that as Samsung has a 'desktop mode' called Samsung DeX, external camera support is tested/a feature. Other Android apps which support external webcam bundle their own library. – Morrison Chang Nov 27 '20 at 00:59
  • @MorrisonChang wow i thought pixel was the most open android. I tried detectrtc on my friends samsung s20 and it did not work. Perhaps its got to be enabled via a flag in the chrome browser. – kristoph Nov 30 '20 at 06:18
  • Going to have to apologize. On the Samsung S9, while the site identified 3 cameras in Chrome and Firefox, it wasn't picking/finding the USB camera, I thought it was, perhaps the 3rd camera for full screen capture? Pixel devices still the easiest for Custom ROM but that doesn't mean stock support for everything. – Morrison Chang Nov 30 '20 at 07:30
  • Hi guys, do you have any updates? I tried Firefox webrtc works well, but with no luck with any version of Chrome on Android – Bin Chen Jan 31 '22 at 03:31

0 Answers0