Giter Club home page Giter Club logo

cordova-camera-roll's Introduction

Cordova Camera Roll

Created by Max Lynch @maxlynch. For Cordova 3.0+

The Cordova Camera Roll plugin makes it easy to read from the iOS camera roll.

Cordova comes with some camera features such as navigator.camera.getPicture. The problem is you have no control over the experience beyond that. On iOS, for example, a modal slides in that lets you choose a picture.

With this plugin you can get a list of all photos and do whatever you want with them after that.

This plugin only works with iOS and was only tested on iOS 7. We will not support other platforms with this plugin for a variety of reasons (possibly Android in the future though).

Installation

To install this plugin, follow the Command-line Interface Guide.

If you are not using the Cordova Command-line Interface, follow Using Plugman to Manage Plugins.

Usage

To use this plugin, make sure you install it just like any Cordova/PhoneGap plugin.

In Javascript, you can do something like this:

CameraRoll.getPhotos(function(photo) {
  // Photo is a URL pointing to the asset. It's prefixed asset-library:// 
  // So if you are using Angular and ng-src, make sure to whitelist this URL scheme.
  //
  // You can use "photo" directly in an img src or as a background-image in CSS.
  //
  // This callback will be called for each photo in the roll. It's async, yo!
});

TODO

Need to do some more testing for failure conditions and permission things.

Also, I want to add block-style reading where you can read in a block of photos at a time, which gives you a little more control and performance over the loading.

cordova-camera-roll's People

Contributors

mlynch avatar

Watchers

James Cloos avatar

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.