How to Enable Webcam in Angular 10 using ngx-webcam ? Last Updated : 21 Aug, 2020 Comments Improve Suggest changes Like Article Like Report 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 10Create a Angular CLI ProjectInstall the package by standard npm command :npm i ngx-webcam package.json Add the WebcamModule component import to app.module.ts file as shown below: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. javascript import { Component } from '@angular/core'; import {WebcamImage} from 'ngx-webcam'; import {Subject, Observable} from 'rxjs'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent { title = 'gfgangularwebcam'; public webcamImage: WebcamImage = null; private trigger: Subject<void> = new Subject<void>(); triggerSnapshot(): void { this.trigger.next(); } handleImage(webcamImage: WebcamImage): void { console.info('Saved webcam image', webcamImage); this.webcamImage = webcamImage; } public get triggerObservable(): Observable<void> { return this.trigger.asObservable(); } } Below is the app.component.html code: html <div> <webcam [height]="400" [width]="1000" [trigger]="triggerObservable" (imageCapture)="handleImage($event)"> </webcam> <button class="actionBtn" (click)="triggerSnapshot();"> Click Here and take the Shot</button> <div class="snapshot" *ngIf="webcamImage"> <h2>Here is your image!</h2> <img [src]="webcamImage.imageAsDataUrl"/> </div> To run this application, run the following command at the terminal: ng serve --open Go to the browser and open the Localhost:4200: Press the button and see the output snapshot: Comment More infoAdvertise with us Next Article How to Enable Webcam in Angular 10 using ngx-webcam ? S ShilpiBose2 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Misc Similar Reads How to Enable HTML 5 Mode in Angular 1.x ? HTML5 mode in Angular1.x is the configuration that replaces the default hash-based URLs and provides more user-friendly URLs using the HTML5 History API. This feature mainly enhances our one-page application and also provides a better experience to the users. We need to configure our server with pro 6 min read How to use angular-calendar in Angular 17? Angular applications often require scheduling and event management features, which can be challenging to implement from scratch. Fortunately, Angular Calendar, a powerful library built specifically for Angular, provides the solution to this problem. In this article, we'll explore how Angular Calenda 2 min read Using ngx-webstorage with Angular 17 Using ngx-webstorage with Angular 17 offers an easy approach to using the power of the browser's Web Storage API within your Angular applications. This article will guide you through the process of integrating ngx-webstorage, a dedicated library for Angular that simplifies client-side data persisten 3 min read How to build progressive web app(PWA) in Angular 9 ? In this article, we will develop a PWA (Progressive Web App) using Angular. What is PWA ? Progressive Web Apps (PWAs) are web applications that have been designed so that they are capable, reliable, and installable. PWA are built and enhanced with modern APIs to deliver enhanced capabilities, reliab 7 min read How to create module with Routing in Angular 9 ? Angular applications are modular, and NgModules is Angular's own modular architecture. NgModules are containers for closely integrated application domains, workflows, or feature sets that comprise cohesive code blocks. Their scope is governed by the NgModule they include, and they can contain compon 4 min read How To Use ViewChild in Angular? In Angular, ViewChild is a powerful decorator that allows you to access and manipulate child components, directives, or DOM elements from a parent component. This feature is essential for scenarios where the parent needs to interact with its child components directly, such as invoking methods, acces 3 min read How To Use ngx toastr in Angular17 ? In Angular, we have a styling component called ngx-toastr, widely used for displaying non-blocking notifications to the user. This component helps enhance the user experience by providing feedback for various actions like success, error, info, and warning messages. By integrating ngx-toastr with Ang 3 min read How to Create a new module in Angular ? Modules are most important when it comes to building strong and scalable Angular applications. They help organize your code, promote modularity, and improve maintainability. It encourages collaboration among developers by grouping related components, directives, pipes, and services. In this article, 3 min read How to add background-image using ngStyle in Angular2 ? The ngStyle Attribute is used to add some style to an HTML element. In this article, we will learn How to add background-image using ngStyle in Angular. To achieve this, we will follow the below approaches.Table of ContentSteps for Installing & Configuring the Angular ApplicationProject Structur 3 min read How to generate QR Codes with Angular 10 ? QR Code (Quick Response Code) has become the essential component for each and every product, organization, app, etc. In marketing campaigns, we can use the generated QR code to Download appsSend EmailView business location etc. In this article let us see how to generate QR Codes with Angular 10. Pre 4 min read Like