const cmr = plus.camera.getCamera(2);
const res = cmr.supportedImageResolutions[0];
const fmt = cmr.supportedImageFormats[0];
cmr.captureImage(p => {
plus.io.resolveLocalFileSystemURL(p, entry => {
this.compressImage(entry.toLocalURL(), entry.name);
}, function(e) {
plus.nativeUI.toast("读取拍照文件错误:" + e.message);
});
}, e => {},{
index:"2"
});
- 发布:2022-11-22 17:36
- 更新:2022-11-22 17:36
- 阅读:196
产品分类: HTML5+
HBuilderX版本号: 3.6.10
手机系统: Android
手机系统版本号: Android 10
手机厂商: vivo
手机机型: IQOOU3
打包方式: 云端
示例代码:
操作步骤:
const cmr = plus.camera.getCamera(2);
const res = cmr.supportedImageResolutions[0];
const fmt = cmr.supportedImageFormats[0];
cmr.captureImage(p => {
plus.io.resolveLocalFileSystemURL(p, entry => {
this.compressImage(entry.toLocalURL(), entry.name);
}, function(e) {
plus.nativeUI.toast("读取拍照文件错误:" + e.message);
});
}, e => {},{
index:"2"
});
const cmr = plus.camera.getCamera(2);
const res = cmr.supportedImageResolutions[0];
const fmt = cmr.supportedImageFormats[0];
cmr.captureImage(p => {
plus.io.resolveLocalFileSystemURL(p, entry => {
this.compressImage(entry.toLocalURL(), entry.name);
}, function(e) {
plus.nativeUI.toast("读取拍照文件错误:" + e.message);
});
}, e => {},{
index:"2"
});
预期结果:
希望能让anroid支持调用前置摄像头进行人脸自拍。
希望能让anroid支持调用前置摄像头进行人脸自拍。
实际结果:
const cmr = plus.camera.getCamera(2);
const res = cmr.supportedImageResolutions[0];
const fmt = cmr.supportedImageFormats[0];
cmr.captureImage(p => {
plus.io.resolveLocalFileSystemURL(p, entry => {
this.compressImage(entry.toLocalURL(), entry.name);
}, function(e) {
plus.nativeUI.toast("读取拍照文件错误:" + e.message);
});
}, e => {},{
index:"2"
});
const cmr = plus.camera.getCamera(2);
const res = cmr.supportedImageResolutions[0];
const fmt = cmr.supportedImageFormats[0];
cmr.captureImage(p => {
plus.io.resolveLocalFileSystemURL(p, entry => {
this.compressImage(entry.toLocalURL(), entry.name);
}, function(e) {
plus.nativeUI.toast("读取拍照文件错误:" + e.message);
});
}, e => {},{
index:"2"
});
bug描述:
我用h5+调用android 前置摄像头,只能调用后置摄像头。
0 个回复