Git Product home page Git Product logo

angular-camera's Introduction

Angular Camera Directive

An Angular directive for easily taking pictures from your webcam.

ngCamera in action

Getting started

  1. Install via Bower using bower install angular-camera
  2. Load the omr.directives module in your application: angular.module('app', ['omr.directives']);

Using ngCamera

<ng-camera
  type="photo"
  enabled="true"
  width="640"
  height="480"
  countdown="3"
  ng-model="media"
  overlay-src="http://example.com/photo-frame.png"
  capture="callback(media)"
  capture-message="Go!"></ng-camera>

Options

  • type string Type of media the capture (photo, video, gif). Photo is currently the only one supported
  • enabled boolean Enables or disables the stream by turning on/off webcam access
  • width integer Width in pixels for the video feed
  • height integer Height in pixels for the video feed
  • countdown integer Countdown time in seconds. Zero is replaced with capture-message text.
  • ng-model object Scope variable to data-bind resulting Base64-encoded image
  • overlay-src string Optional. Reference to image frame to overlay onto media. Automatically resizes to fit canvas.
  • capture function Callback for "Take Picture" button for use in parent scope. Passes Base64-encoded output as parameter
  • capture-message string Optional. Text to show during countdown instead of "0"

Built by Zach Dunn from work on the Robin Platform

angular-camera's People

Contributors

exocom avatar mkly avatar ppotoplyak avatar youshea avatar zachdunn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-camera's Issues

Taking picture yields completely black photo

I've started a project using angular camera: https://github.com/ShaneKilkelly/snaply

The camera is set up like so:

<ng-camera
      type="photo"
      enabled="true"
      width="400"
      countdown="3"
      ng-model="media"
      capture-message="Go!"></ng-camera>

The webcam image appears on the page as expected.

When "take a picture is clicked", the result is that $scope.media is set to a base64 encoded string of a completely black image. No errors are shown in the js console.

When the image is either rendered in an img tag (<img src="{{media}}" />), or opened in a new tab, it appears as a completely black rectangle.

The base64 string generated is in this gist: https://gist.github.com/ShaneKilkelly/7975159

Tested on Chrome 31.0.1650.63, Ubuntu 13.10, Angular version 1.2.4

No video on deploy

Hi,
I used your library with bower and yoeman generator. It works locally, but when I deploy the project there is no video, or error.

Can you help me?
Thank you,
K

Type Error

I have tried using your library. Readme doc seems everythings sorted. got me pretty excited. Since no one else raised up this issue, probably I am doing something wrong here.
• installed bower
• install angular-camera using bower
• angular modules directive is 'omr.directives'
• included the ng-camera tag as shown

But it shows me these errors in console

scope.media.replace is not a function
at angular-camera.js:129

Video

Any updates on videos?

Returns undefined for image output

<div class="col-md-12 text-center">
        <ng-camera
        type="photo"
        enabled="true"
        width="640"
        height="480"
        countdown="3"
        ng-model="media"
        overlay-src=""
        capture="callback(image)"
        capture-message="Go!"></ng-camera>
    </div>

Angular version : 1.2.15

Camera not showing anymore after update on Firefox

After a update on firefox that recently was applied in chrome too, the camera doest not work anymore.

Probably because of this:
https://www.fxsitecompat.com/en-CA/docs/2018/url-createobjecturl-no-longer-accepts-mediastream-as-argument/

Can someone help-me ?

On the line 41 the method deprecated is being used:

`scope.enableCamera = function () {
return navigator.getUserMedia({
audio: false,
video: true
}, function (stream) {
return scope.$apply(function () {
scope.stream = stream;
scope.isLoaded = true;
41 return scope.videoStream = $sce.trustAsResourceUrl(window.URL.createObjectURL(stream));
});
}, function (error) {
return scope.$apply(function () {
scope.isLoaded = true;
return scope.noCamera = true;
});
});

Tag the latest code?

It looks like you updated the bower.json to point to the dist folder, but never tagged the release/bumped the version number so when I bower install, the older version is installed.

Can you update pleez?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.