解释:swan.createARCameraContext 的返回值。
Web 态说明:Web 态暂不支持 ar-camera 功能。在 Web 态调用 ARCameraContext 的各方法会做 打开百度 App 对应小程序页面 的降级处理。

正宁ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!
跳转编辑工具
在开发者工具中打开
在 WEB IDE 中打开
扫码体验
代码示例
请使用百度APP扫码
Page({
data: {
src: ''
},
onShow() {
const cameraContext = swan.createCameraContext();
this.cameraContext = cameraContext
swan.showModal({
title: '这是ARCameraContext创建的实例对象',
content: JSON.stringify(cameraContext)
})
},
takePhoto() {
this.cameraContext.takePhoto({
quality: 'high',
success: res => {
this.setData({
src: res.tempImagePath
});
}
});
},
startRecord() {
this.cameraContext.startRecord({
success: res => {
swan.showToast({
title: 'startRecord'
});
}
});
},
stopRecord() {
this.cameraContext.stopRecord({
success: res => {
swan.showModal({
title: '提示',
content: res.tempVideoPath
});
this.setData({
videoSrc: res.tempVideoPath
});
}
});
}
});