{"id":18615039,"url":"https://github.com/andrewjbateman/angular-webcam-video-capture","last_synced_at":"2025-05-07T03:43:43.664Z","repository":{"id":40668323,"uuid":"158539781","full_name":"AndrewJBateman/angular-webcam-video-capture","owner":"AndrewJBateman","description":":clipboard: Displays webcam video stream and captures images from local PC using a web browser. Photos can be captured using a button that will save the images in an array. Works in Chrome only.","archived":false,"fork":false,"pushed_at":"2023-02-04T06:54:14.000Z","size":2032,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T03:43:43.399Z","etag":null,"topics":["angular15","captures-images","css3","html5","mediastream","photos","video-capture","webcam"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-21T11:46:59.000Z","updated_at":"2022-12-27T20:46:43.000Z","dependencies_parsed_at":"2023-02-18T14:25:15.689Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/angular-webcam-video-capture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-webcam-video-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-webcam-video-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-webcam-video-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-webcam-video-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-webcam-video-capture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810272,"owners_count":21807759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular15","captures-images","css3","html5","mediastream","photos","video-capture","webcam"],"created_at":"2024-11-07T03:27:55.704Z","updated_at":"2025-05-07T03:43:43.634Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Angular Webcam Video Capture\n\n* Displays webcam video stream and captures images from local PC web browser.\n* Photos can be captured using a button that will save the images in an array.\n* Works in Chrome only.\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/angular-webcam-video-capture?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/angular-webcam-video-capture?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/angular-webcam-video-capture?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/angular-webcam-video-capture?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Angular Webcam Video Capture](#zap-angular-webcam-video-capture)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* The captured pictures are added to a 'captures' array. This is cleared each time after the app initialises as part of the ngOnInit lifecycle hook.\n* The `srcObject` property of the HTMLMediaElement interface is now used to get webcam video stream due to [deprecation of \"createObjectURL\"](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject).\n* This a simple app. No Jasmine/Karma testing included this time.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/webcam-video-capture.png).\n\n## :signal_strength: Technologies\n\n* [Angular v15](https://angular.io/)\n* [Angular ElementRefs](https://angular.io/api/core/ElementRef#description) used as a wrapper inside of a View. Security issues with this method and it means service workers cannot be used. Better to use templating and databinding or use Renderer2.\n* [Angular ViewChild](https://angular.io/api/core/ViewChild) decorator used to configure a view query.\n* [navigator.mediaDevices.getUserMedia()](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) method used to prompt the user for permission to use a media input which produces a MediaStream. It returns a Promise that resolves to a MediaStream object (assuming permission is given). A catch function was added to alert the user to any errors.\n\n## :floppy_disk: Setup\n\n* `npm i` to install dependencies\n* Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n## :computer: Code Examples\n\n* Extract from `app.component.ts` showing code to get video stream.\n\n```typescript\n\n    public ngAfterViewInit() {\n        if(navigator.mediaDevices \u0026\u0026 navigator.mediaDevices.getUserMedia) {\n            navigator.mediaDevices.getUserMedia({ video: true }).then(stream =\u003e {\n                this.video.nativeElement.srcObject = stream;\n                this.video.nativeElement.play();\n            });\n        }\n    }\n```\n\n## :cool: Features\n\n* Works with [Google Chrome Version 86 Official Build 64 bits](https://www.google.com/chrome/).\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working.\n* To-Do: Add an improved UI. Add database connection to store captured photos.\n\n## :clap: Inspiration\n\n* [Nic Raboy of X-Team blog: CAPTURE WEBCAM IMAGES FROM A BROWSER WITH ANGULAR](https://x-team.com/blog/webcam-image-capture-angular/)]\n* [Matt McAlister: Get You Some Media With getUserMedia()](https://medium.com/@matt.mcalister93/get-you-some-media-with-getusermedia-726cde161cd7)\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-webcam-video-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-webcam-video-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-webcam-video-capture/lists"}