如何解决使用电容器/ PWA-ELements离子角应用时,PWA不打开后置摄像头
使用电容器和PWA元素,我们按照以下代码在移动设备上单击照片
if (!Capacitor.isPluginAvailable('Camera')) {
this.fileinput.nativeElement.click();
return;
}
else {
const image = await Plugins.Camera.getPhoto({
quality: 20,allowEditing: false,direction: CameraDirection.Rear,correctOrientation: true,resultType: CameraResultType.Base64,source: CameraSource.Camera
}).then((image) => {
this.imgBase64List.push(image.base64String);
this.imgBase64ListDisplay.push("data:image/jpeg;base64," + image.base64String);
// localStorage.setItem(this.TsList.TSNo+ "GpInImageBase64",JSON.stringify(this.imgBase64List));
this.storeImage();
}).catch((error) => {
this.showToast(error)
});
/* this.imgBase64List.push(image.base64String);
this.imgBase64ListDisplay.push("data:image/jpeg;base64," + image.base64String);
// localStorage.setItem(this.TsList.TSNo+ "GpInImageBase64",JSON.stringify(this.imgBase64List));
this.storeImage(); */
}
摄像头方向始终位于后方,但它始终在PWA中打开前置摄像头,因为它非常适合作为本机应用程序(apk)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。