【发布时间】:2014-12-01 11:01:41
【问题描述】:
我开始使用 PhoneGap 与 Meteor 的集成,但无法让插件正常工作。有人可以提供以下我将如何使用相机插件的步骤。目前我只在模拟器上运行它。代码如下。提前致谢。
我添加了这样的相机插件: 流星添加cordova:org.apache.cordova.camera@0.3.1
然后使用它我有以下代码:
if (Meteor.isClient) {
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
navigator.camera.getPicture(
function(data){ Session.set("picture", res); },
function(err){ console.log(err); },
{
quality: 50,
destinationType: Camera.DestinationType.DATA_URL
}
);
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
当我点击按钮时出现此错误:
I20141006-21:58:33.174(-7)? (ios) Camera.getPicture: source type 1 not available.
I20141006-21:58:33.222(-7)? (ios) no camera available
【问题讨论】:
-
我不相信 iPhone 模拟器允许 GPS 或照片。我发现 Chrome 将允许您同时执行这两项操作。
-
@CodeChimp 此代码在 Android 模拟器上启动相机,但在浏览器上不起作用。有什么想法吗?
-
查看我几周前的问题:stackoverflow.com/questions/26182267/…
标签: cordova meteor phonegap-plugins cordova-plugins