Cordova 如何使用Meteor PhoneGap插件
我刚开始使用PhoneGap与Meteor的集成,但很难让插件正常工作。请有人提供以下步骤,我将如何使用相机插件。目前我只在模拟器上运行它。代码如下。先谢谢你 我添加了如下摄像头插件: meteor add cordova:org.apache.cordova。camera@0.3.1 然后使用它,我有以下代码:Cordova 如何使用Meteor PhoneGap插件,cordova,meteor,phonegap-plugins,cordova-plugins,Cordova,Meteor,Phonegap Plugins,Cordova Plugins,我刚开始使用PhoneGap与Meteor的集成,但很难让插件正常工作。请有人提供以下步骤,我将如何使用相机插件。目前我只在模拟器上运行它。代码如下。先谢谢你 我添加了如下摄像头插件: meteor add cordova:org.apache.cordova。camera@0.3.1 然后使用它,我有以下代码: if (Meteor.isClient) { Template.hello.events({ 'click button': function () { //
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
根据Meteor Cordova Phonegap集成文档 任何依赖Cordova/Phonegap插件的功能都应该 将代码包装在Meteor.startup()块中
Docs我认为iPhone模拟器不允许GPS或照片。我发现,Chrome将允许您同时执行这两项操作。@CodeChimp此代码在Android仿真器上启动摄像头,但在浏览器上不起作用。有什么想法吗?看看我几周前的问题: