ionic-framework - 无法在 ionic 3 中执行“createObjectURL”
问题描述
[在此处输入图像描述][1]我在使用操作表打开相机时使用了面临的问题并出现以下错误。
CameraProxy.js:105 未捕获类型错误:无法在“URL”上执行“createObjectURL”:未找到与提供的签名匹配的函数。在成功回调(CameraProxy.js:105)
我的离子相机版本是"@ionic-native/camera": "^4.3.0"
.
操作表或本机插件有问题吗?
我的相机正在启动但无法正常工作。
以下是相机的打字稿代码
const actionSheet = this.actionSheetController.create({
title: 'Actions',
buttons: [{
text: 'upload',
role: 'destructive',
icon: 'upload',
handler: () => {
console.log('camera clicked');
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
};
this.camera.getPicture(options).then((imageData) => {
this.ProfileInfo.profileImagePath = 'data:image/png;base64,' + imageData;
this.ProfileInfo.profileimage = imageData;
this.updateImage(this.ProfileInfo);
}, (err) => {
});
}
}, {
text: 'camera',
icon: 'camera',
handler: () => {
console.log('camera clicked');
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.CAMERA
};
this.camera.getPicture(options).then((imageData) => {
this.ProfileInfo.profileImagePath = 'data:image/png;base64,' + imageData;
this.ProfileInfo.profileimage = imageData;
this.updateImage(this.ProfileInfo);
}, (err) => {
});
}
}, {
text: 'Cancel',
icon: 'close',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}]
});
actionSheet.present();
解决方案
推荐阅读
- c# - 如何以编程方式构建服务器 url?
- google-apps-script - 以格式化格式返回日期(迭代)
- python - 使用scrapy管道写入文件
- docker - 如何使用调度程序(cron)容器在其他容器中执行命令
- mysql - 创建视图连接具有相同列且不重复的两个表
- oracle - Hibernate query to get Data from Oracle table inserted in last 5 mins
- c# - Two order bys then picking the last element in linq
- sql-server - 服务器名称更改后如何使用相同的 SQL 连接字符串?
- opengl - 这个 gltf 文件中的框的索引是如何工作的?
- html - 创建响应式网格布局,其中所有元素在垂直和水平方向上彼此等距