basst314 / ngx-webcam

A simple Angular webcam component / pure & minimal, no flash-fallback
https://basst314.github.io/ngx-webcam/?
MIT License
228 stars 104 forks source link

There is no pause & play webcam option. #81

Closed farhaan008 closed 3 years ago

farhaan008 commented 4 years ago

After image capture i want to pause webcam for a moment meanwhile call a rest api (to verify face present in image) so in case of failure want to play webcam again for recapture.

jbistis commented 4 years ago

Something like this works...<webcam *ngIf="(webCameraEnabled && !!!haveImage); else elseBlock" [trigger]="triggerObservable" (imageCapture)="handleImage($event)" [allowCameraSwitch]="allowCameraSwitch" [imageQuality]="1" (initError)="handleInitError($event)"></webcam> <div *ngIf="!webCameraEnabled">{{initErrorMsg}}</div> <ng-template #elseBlock> <img [src]="webcamImage.imageAsDataUrl" /> </ng-template>

basst314 commented 3 years ago

Hi @farhaan008,

this can be achieved by removing the webcam component from the page and displaying the captured image for a moment instead. If you need to re-capture, just add ngx-webcam again.

I'm resolving this issue. If your issue still persists, please feel free to reopen.

Thanks!