2

I'm having issue with ngx-webcam plugin in Angular4+, as i'm using this plugin to capture images in my application but when user doesn't allow permission of using webcam then I should make a change from capturing to upload a image from computer or mobile.

In this ngx-webcam plugin we do have, to turn on/off webcam but what i need is to identify if user gave permission or not to use webcame for capturing image.

I'm trying to get this resolved and searched a lot but couldn't find anything relevant to find whether a user allowed

kishore
  • 356
  • 1
  • 3
  • 20

2 Answers2

0

  public handleInitError(error: WebcamInitError): void {
    if (error.mediaStreamError && error.mediaStreamError.name === 'NotAllowedError') {
      this.camPermission = true;
      console.warn('Camera access was not allowed by user!');
    }
  }
<webcam (initError)="handleInitError($event)"></webcam>
0

Display errors and then take action accordingly

Zia Khan
  • 188
  • 2
  • 9