Fork me on GitHub
This API is deprecated since version 1.3.0 and no longer available since version 1.3.1

$meteor.camera

A helper service for taking pictures across platforms.

Must add mdg:camera package to use!

This module has moved into a separate package here. Please update your existing code by adding that package or by using the regular mdg:camera package package.


Usage

    meteor add mdg:camera

    $meteor.getPicture(:options);

Arguments

Param Type Details Required
options Object options is an optional argument that is an Object with the following possible keys: width - An integer that specifies the minimum width of the returned photo. height - An integer that specifies the minimum height of the returned photo. * quality - A number from 0 to 100 specifying the desired quality of JPEG encoding. no

Returns

promise(data) The promise solved successfully when the picture is taken with the data as a parameter or rejected with an error as a parameter in case of error.

Example

JavaScript:

if (Meteor.isClient) {

  app.controller("cameraCtrl", ['$scope', '$meteor',
    function($scope, $meteor){

      $scope.takePicture = function(){
        $meteor.getPicture().then(function(data){
          $scope.party.imageData = data;
        });
      };

    }]);
  }

}

HTML:

    <div ng-controller="cameraCtrl">
      <button ng-click="takePicture()">Picture</button>
      <img ng-src="{{dstache}}party.imageData}}">
    </div>