ngx-webcam icon indicating copy to clipboard operation
ngx-webcam copied to clipboard

Switching the camera will freeze the Chrome app on Android phone in the live demo.

Open angroPowel opened this issue 3 years ago • 7 comments

Hi,

Device: Samsung s20 Android 11 Chome 89.0.4389.105. Angular 10

I have implemented ngx-webcam into my project. It works fine on PC, but on the phone the entire chrome app freezes if you try the "flip" camera button. Sometimes it works to flip the camera 2 or 3 times before it freezes, sometimes it freezes on the first try. Same issue if you use the "next webcam" button or the "flip" camera found on the image.

To recreate the issue simply try the live-demo on android phone using chrome.

I tested it in Edge and it worked fine there, but I need it to work in chrome as well.

Anyone have any suggestions for solving this?

angroPowel avatar Mar 25 '21 13:03 angroPowel

There is a possible connection to a Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1183362 Has to do with camera ID - seemingly chromium code assumes the camera ID is identical to a 0-based index, but newer cameras use other numbers / strings as camera ID.

The above problem description does not give enough details to verify that really the Chromium bug is causing the freezing, but it seems possible and plausible. Maybe @angroPowel you want to check/confirm?

EdithBirrer1 avatar Apr 07 '21 08:04 EdithBirrer1

@EdithBirrer1 is camera ID any different from Device ID? I checked on my Samsung s20, and I have 4 available video devices. Each of them have a device ID with a long string with 60+ characters of both letters and numbers. The entire browser freezes, so I don't get any error message.

angroPowel avatar Apr 07 '21 12:04 angroPowel

The camera id is different from the device id. The camera id is the one used internally in Android. The developers have pushed a fix that is available in Chrome Canary. Feel free to try it out in Chrome Canary, here it fixed the problem. Apparently there is still an issue if the camera is connected externally. The pushed fix in Canary only works with internal cameras.

Dravere avatar Apr 20 '21 10:04 Dravere

Thank you for the tip. I tested it on Chrome Canary on my Android Phone and it worked. Do you have any idea of when this will be released in "normal" Chrome?

angroPowel avatar Apr 20 '21 10:04 angroPowel

Sadly I don't have this information. I'd love to know that too.

Dravere avatar Apr 20 '21 11:04 Dravere

Hi @angroPowel, Does this issue still happen with the latest version of this library (0.4.1)?

basst314 avatar Dec 03 '21 08:12 basst314

Is this error not resolved yet??

shivangguptaa avatar Nov 29 '22 10:11 shivangguptaa