basst314/ngx-webcam

Removing Webcam component freezes chrome on mobile

CColon1 opened this issue · 4 comments

Using Pixel 4xl but seen on other android devices also.
Chrome OS (latest as of today): 88.0.4324.181, but seen on previous versions also.

Hiding the webcam using *ngIf causes the browser to freeze. have to lock the phone and unlock to proceed.

To recreate use the demo app and toggle the webcam a few times.

We were able to work around this issue by doing
(this.childRef.nativeVideoElement as HTMLVideoElement).pause();
(this.childRef.nativeVideoElement as HTMLVideoElement).src = null;

Before hiding the component.

Same problem here. Chrome freezes on Pixel 3. Switching apps and returning to Chrome makes Chrome usable again.

Workaround works for me as well. Thanks @CColon1

Hi @CColon1,
A fix to pause the video element on-destroy has been added in #106 and is part of release 0.4.1. Please try updating to this version of the library.
Thanks!