13518219792

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

创新互联百度小程序教程:ARCameraContext

ARCameraContext

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

正宁ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!

示例

跳转编辑工具

在开发者工具中打开

在 WEB IDE 中打开

扫码体验

代码示例

请使用百度APP扫码

图片示例

代码示例

 
 
 
  1. Page({
  2. data: {
  3. src: ''
  4. },
  5. onShow() {
  6. const cameraContext = swan.createCameraContext();
  7. this.cameraContext = cameraContext
  8. swan.showModal({
  9. title: '这是ARCameraContext创建的实例对象',
  10. content: JSON.stringify(cameraContext)
  11. })
  12. },
  13. takePhoto() {
  14. this.cameraContext.takePhoto({
  15. quality: 'high',
  16. success: res => {
  17. this.setData({
  18. src: res.tempImagePath
  19. });
  20. }
  21. });
  22. },
  23. startRecord() {
  24. this.cameraContext.startRecord({
  25. success: res => {
  26. swan.showToast({
  27. title: 'startRecord'
  28. });
  29. }
  30. });
  31. },
  32. stopRecord() {
  33. this.cameraContext.stopRecord({
  34. success: res => {
  35. swan.showModal({
  36. title: '提示',
  37. content: res.tempVideoPath
  38. });
  39. this.setData({
  40. videoSrc: res.tempVideoPath
  41. });
  42. }
  43. });
  44. }
  45. });

当前题目:创新互联百度小程序教程:ARCameraContext
文章源于:http://cdbrznjsb.com/article/dhedegd.html

其他资讯

让你的专属顾问为你服务