All Projects → weberamaral → ng-webcam

weberamaral / ng-webcam

Licence: MIT license
ngWebcam is an AngularJS directive for capturing images from your computer's camera, and delivering then to you as data uri.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to ng-webcam

Webcamjs
HTML5 Webcam Image Capture Library with Flash Fallback
Stars: ✭ 2,363 (+16778.57%)
Mutual labels:  camera, data-uri, webcamjs
Camerakit Android
Library for Android Camera 1 and 2 APIs. Massively increase stability and reliability of photo and video capture on all Android devices.
Stars: ✭ 5,131 (+36550%)
Mutual labels:  camera, captured-images
angular-barcode
An angular directive for lindell's JsBarcode
Stars: ✭ 25 (+78.57%)
Mutual labels:  angularjs, bower
Angular Loading Feedback
Angular directive to indicate loads in app
Stars: ✭ 8 (-42.86%)
Mutual labels:  angularjs, bower
angular-mapboxgl-directive
AngularJS directive for Mapbox GL
Stars: ✭ 43 (+207.14%)
Mutual labels:  angularjs, bower
Angular Translate
Translating your AngularJS 1.x apps
Stars: ✭ 4,414 (+31428.57%)
Mutual labels:  angularjs, bower
project-manager-laravel
Project manager system - PHP and AngularJS
Stars: ✭ 17 (+21.43%)
Mutual labels:  angularjs, bower
vue-base64-file-upload
Upload files as base64 data-uris
Stars: ✭ 77 (+450%)
Mutual labels:  data-uri
vote
Abakus' Voting System
Stars: ✭ 25 (+78.57%)
Mutual labels:  angularjs
kodi-angular
A web interface to control and manage Kodi, using AngularJS.
Stars: ✭ 14 (+0%)
Mutual labels:  angularjs
camera.ui
NVR like user Interface for RTSP capable cameras
Stars: ✭ 99 (+607.14%)
Mutual labels:  camera
ng-contenteditable
ng-contenteditable
Stars: ✭ 41 (+192.86%)
Mutual labels:  angularjs
bevy 4x camera
A 4X style camera for bevy.
Stars: ✭ 26 (+85.71%)
Mutual labels:  camera
AngularJS1.x-webpack-seed
使用angular1.5 + es2015 + webpack 练习demo
Stars: ✭ 18 (+28.57%)
Mutual labels:  angularjs
symfony-angular-todomvc
An implementation of TodoMVC using AngularJS and Symfony REST Edition
Stars: ✭ 94 (+571.43%)
Mutual labels:  angularjs
AstroPhoto-Plus
A lightweight, web based astrophotography sequence generator and INDI client written in Python and React.
Stars: ✭ 54 (+285.71%)
Mutual labels:  camera
CVSandbox
Open source software package, which aims to allow solving different tasks related to computer vision areas, like video surveillance, vision based automation/robotics, different sorts of image/video processing, etc.
Stars: ✭ 56 (+300%)
Mutual labels:  camera
boilerplate-angular-es6-webpack2
Boilerplate angular 1.x with ES6 and Webpack 2
Stars: ✭ 16 (+14.29%)
Mutual labels:  angularjs
main
Share your personal pronouns and stay updated on your friends' pronouns. Pronouny allows you to update your pronouns and send alerts to your friends.
Stars: ✭ 37 (+164.29%)
Mutual labels:  angularjs
sf-java-ui
Json Schema Form java based library allow developers to define schema and form using field annotations
Stars: ✭ 23 (+64.29%)
Mutual labels:  angularjs

ng-webcam

Dependency Status devDependency Status

Build Status covarage

ngWebcam is an AngularJS directive for capturing images from your computer's camera, and delivering then to you as JPEG or PNG Data URIs. The images can then be displayed in your web page, render into a canvas or submited to your server. ngWebcam uses WebcamJS to provide the core functionality.

Browser suport

ngWebcam suports the same browsers supported by WebcamJS.

Live exemple

To see live exemple, go to the sample page

Instalation

Using Bower

bower install ng-webcam

Usage

Import files scripts

ngWebcam uses WebcamJS to work properly so you need to add the script in your main file, don't forget to load the directive file:

<script src"/path/to/webcam.js"></script>
<script src"/path/to/ng-webcam.js"></script>

Add the module as dependency

Simply add the module as dependency to your main application module likes this:

angular.module("app", ["ng-webcam"]);

The directive

<ng-webcam 
    config="vm.config"
    on-error="vm.onError(err)"
    on-load="vm.onLoad()"
    on-live="vm.onLive()"
    on-capture-progress="vm.onCaptureProgress(src, progress)"
    on-capture-complete="vm.onCaptureComplete(src)">
</ng-webcam>

Options

ng-webcam comes with lots of options to simplify tour development:

Callbacks

  • on-error function Callback function for error. Fires when the WebcamJS library erro occurs (your callback function is passed an error string)
  • on-capture-complete function Callback function for capture complete action. Fires when the capture completes (your callback function is passed an array string (data_uri) in src parameter)
  • on-load function Callback function for load action camera. Fires when the WebcamJS library finisheds loading
  • on-live function Callback function for live action camera. Fires when the user's camera goes live - this will only happen after the user allows access to their camera
  • on-capture-progress function Callback function for each capturing image with progress. Fires repeatedly while an capturing progress (your callback function is passed an string (data_uri) in src parameter and an number (progress) in progress parameter)

Config

  • config object Config options for init params in WebcamJS e directive | optional
    • viewerWidth number Width of live camera viewer in pixels| default to actual size of the DOM element auto
    • viewerHeight number Height of live camera viewer in pixels| default to actual size of the DOM element auto
    • outputWidth number Width of captured snapshot image in pixels | default 320
    • outputHeight number Height of captured snapshot image in pixels | default 240
    • delay number Number of seconds to wait and display before getting snapshot | default 0
    • shots number Number of shots captured images | default 1
    • shutterUrl string Shutter sound's url to play when taking snapshot | optional
    • flahFallbackUrl string Url of the Adobe Flash player to enable the fallback and crossbrowser modes, default based on navigator.getUserMedia
    • countdown number Number of seconds to wait and display camera frame | optional

Dispatches events

  • ngWebcam_capture event Notifies when it should be carried out to capture the camera
  • ngWebcam_on event Notifies when the camera must be on
  • ngWebcam_off event Notifies when the camera should be turned off

Working example

A working example is available in gh-pages branch. Make sure to install bower and node dependencies, after checkout branch.

npm install && bower install

Then start the node server, it will ne accessible on http://0.0.0.0:3000

node server.js

License

The MIT License (MIT)

Copyright (c) 2015 Weber Amaral

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARR

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].