使用Meteor.js和Cordova访问iOS照片应用程序的照片

问题描述:

如何从照片iOS应用程序中选择照片?使用Meteor.js和Cordova访问iOS照片应用程序的照片

安装了mdg:camera,我只能通过使用iPhone的相机拍摄照片。我们如何从照片应用中选择现有照片?

var cameraOptions = { 
    width: 800, 
    height: 600 
}; 

MeteorCamera.getPicture(cameraOptions, function (error, data) { 
    console.log('photo: ', data) 
}); 
+0

这可能有助于http://www.raymondcamden.com/2013/07/23/better-example-of-phonegap-parse-and-uploading-files – Nimir 2015-01-23 06:07:38

刚刚发布关于该帖子...

基本上所有你需要做的就是添加sourceType的你cameraOptions,像这样:

var cameraOptions = { 
    width: 800, 
    height: 600, 
    sourceType: Camera.PictureSourceType.PHOTOLIBRARY 
}; 

**注:**这只有在使用Cordova时才有效。

原贴:http://differential.com/blog/access-the-photo-library-in-your-meteor-cordova-app

演示回购:https://github.com/spencercarli/meteor-cordova-photolibrary

如果你想同时使用,你可以使用:

meteor add okland:camera-ui 

并使用调用的方法和发送相同的选项:

var cameraOptions = { 
    width: 800, 
    height: 600, 
}; 
MeteorCameraUI.getPicture(cameraOptions, callback) 

camera-ui use mdg:camera so you can us us e相同的选项。