我是 Node.js 的新手,已经开始使用 Ionic 和 Cardova Camera API 制作我自己的应用程序。
我目前使用这个 demo. 启动 android 设备 的相机
我想做的是将相机本身嵌入到应用程序中,而不是启动相机,但我不知道从哪里开始..
Cordova 是否支持这种类型的功能,或者我必须使用 PhoneGap 吗?
例如 phonegap. 中的这个
或者自己写一个自定义相机?
最佳答案
事实上,您可以使用 Ionic 做到这一点。看看这个official guide .
一个简短的总结是这样的:
- cordova 插件添加 org.apache.cordova.camera
例如这样使用它:
function takePicture() { navigator.camera.getPicture(function(imageURI) { // imageURI is the URL of the image that we can use for // an <img> element or backgroundImage. }, function(err) { // Ruh-roh, something bad happened }, cameraOptions); }
关于android - Ionic App w/Cordova,如何嵌入相机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31197393/