VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/how-to-enable-webcam-in-angular-10-using-ngx-webcam/

⇱ How to Enable Webcam in Angular 10 using ngx-webcam ? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Enable Webcam in Angular 10 using ngx-webcam ?

Last Updated : 21 Aug, 2020

ngx-webcam component provides access of webcam to take snapshots simply via actions and event-bindings in Angular 10. This component gives us full control and permission to capture images in an easy way.

Steps to add webcam to your application:

  • Install Angular 10
  • Create a Angular CLI Project
  • Install the package by standard npm command :
    npm i ngx-webcam
    👁 Image
    package.json
  • Add the WebcamModule component import to app.module.ts file as shown below:
    👁 Image
    app.module.ts
  • Now add the WebcamImage component from ngx-webcam package library in app.component.ts file and use it in AppComponent Class to handle the functionality of webcam.
  • Below is the app.component.html code:
  • To run this application, run the following command at the terminal:
    ng serve --open
  • Go to the browser and open the Localhost:4200:👁 Image
  • Press the button and see the output snapshot: 👁 Image
Comment
Article Tags:

Explore