Skip to content

The same as mdg:camera but fixed error with stream.stop in Chrome

Notifications You must be signed in to change notification settings

viktors264/meteor-camera

 
 

Repository files navigation

Meteor Camera Package

Add it to your Meteor app with meteor add perak:camera. The api is super simple - there is only one function to call.

MeteorCamera.getPicture([options], callback)

Prompt the user to take a photo with their device and get the picture as a Data URI in JPEG format.

options

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.

callback(error, data)

callback is a required argument that is a function that takes two arguments:

  • error A Meteor.Error with a platform-specific error message.
  • data A base64-encoded data URI for the image taken by the camera. This parameter can be used directly in the 'src' attribute of an image tag.

Warning: In the iOS simulator, the device camera is not accessible so you will get an error that says "source type 1 not available."

About

The same as mdg:camera but fixed error with stream.stop in Chrome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 61.8%
  • HTML 22.6%
  • CSS 15.6%