npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

cordova-plugin-preview-camera

v0.0.14

Published

Cordova plugin that allows camera interaction from HTML code. Show camera preview below or on top of the HTML.

Readme

cordova-plugin-preview-camera

This repository was copied with the idea to use it with Meteor with new features. The use for now is only with Android If you've got problems related with these new features or using it with Meteor add here an issue here but for further info would be better to publish them into main repository here: https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview/issues

Features added and tested so far:

How to install with Meteor: Type in your terminal meteor add cordova:[email protected] (actual version). Not tested in Meteor 1.4 yet.

Npm: https://www.npmjs.com/package/cordova-plugin-preview-camera

------- Original info ---------

Cordova plugin that allows camera interaction from HTML cod for showing camera preview below or above the HTML.

May 18, 2016 - Plugin is starting to be maintained again, current development to get a decent stable updated version is happening on the fork westonganger/cordova-plugin-preview-camera. This will be merged into master here once its working. Please direct all pull requests over there until further notice.

cordova plugin add https://github.com/cordova-plugin-preview-camera/cordova-plugin-preview-camera.git

Phonegap Build:

<gap:plugin name="cordova-plugin-preview-camera" />

startCamera(rect, defaultCamera, tapEnabled, dragEnabled, toBack) Starts the camera preview instance. When setting the toBack to TRUE, remember to add the style bellow on your app's HTML body element:

style="background-color='transparent'"

Javascript:

var tapEnabled = true; //enable tap take picture
var dragEnabled = true; //enable preview box drag across the screen
var toBack = true; //send preview box to the back of the webview
var rect = {x: 100, y: 100, width: 200, height:200};
cordova.plugins.camerapreview.startCamera(rect, "front", tapEnabled, dragEnabled, toBack)

stopCamera() Stops the camera preview instance.

cordova.plugins.camerapreview.stopCamera();

takePicture(size) Take the picture, the parameter size is optional

cordova.plugins.camerapreview.takePicture({maxWidth:640, maxHeight:640});

setOnPictureTakenHandler(callback) Register a callback function that receives the original picture and the image captured from the preview box.

cordova.plugins.camerapreview.setOnPictureTakenHandler(function(result){
	document.getElementById('originalPicture').src = result[0];//originalPicturePath;
	document.getElementById('previewPicture').src = result[1];//previewPicturePath;
});

switchCamera() Switch from the rear camera and front camera, if available.

cordova.plugins.camerapreview.switchCamera();

show() Show the camera preview box.

cordova.plugins.camerapreview.show();

hide() Hide the camera preview box.

cordova.plugins.camerapreview.hide();

Base64 image: Use the cordova-file in order to read the picture file and them get the base64. Please, refer to this documentation: http://docs.phonegap.com/en/edge/cordova_file_file.md.html Method readAsDataURL: Read file and return data as a base64-encoded data URL.

Sample: Please see the CordovaCameraPreviewApp for a complete working example for Android and iOS platforms.