【发布时间】:2015-04-01 13:52:27
【问题描述】:
我需要使用我的 Phonegap 应用程序拍摄图像。在 iOS 上一切正常,但在 Android 上(通过 Phonegap Build)它会抛出“错误捕获图像”错误。
我在 config.xml 中添加了以下几行,但这并没有改变任何内容:
<feature name="Camera">
<param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
</feature>
<feature name="http://api.phonegap.com/1.0/device" />
<feature name="http://api.phonegap.com/1.0/camera" />
<feature name="http://api.phonegap.com/1.0/file" />
<feature name="http://api.phonegap.com/1.0/media" />
<feature name="http://api.phonegap.com/1.0/network" />
我的 API 调用如下所示:
$(document).on('click', '#cameraPreview', function() {
pictureSource = navigator.camera.PictureSourceType;
destinationType = navigator.camera.DestinationType;
navigator.camera.getPicture(onGetPictureSuccess, onGetPictureFail, {
quality: 40,
sourceType: Camera.PictureSourceType.CAMERA,
destinationType: Camera.DestinationType.FILE_URI,
allowEdit: true,
encodingType: Camera.EncodingType.JPG,
targetWidth: 1000,
targetHeight: 1000,
saveToPhotoAlbum: true,
correctOrientation: 1
});
});
我将 Phonegap 3.7 与 Phonegap Build 一起使用。
【问题讨论】:
-
请包含
config.xml的标题行