onCameraFrame 在 android 部分机型不存在
发布于 7 年前 作者 linli 6121 次浏览 来自 官方Issues

问题 :循环输出 wx.createCameraContext() 实例属性时,发现onCameraFrame 在 android 部分机型不存在,无法成功调用实现AR功能;希望尽快修复或提供解决方案。谢谢

测试机型:

oppo R15 ;android版本:8.1.0 ;微信版本7.0.8

huawei P30 ;android版本:9.1.0.226;微信版本7.0.8

测试代码:

<camera
device-position="back"
flash="off"
binderror="error"
style="width:{{width}}px; height: {{height}}px;"
frame-size="large"
></camera>
<cover-view style="z-index:111111; position:fixed;left:0;top:0;width:100vw;height:100vh;background:#f00;color:#fff;">
    <cover-view wx:for="{{wx}}" wx:key="index">
{{item}}
    </cover-view>
    <cover-view>{{testVal}}</cover-view>
</cover-view>
const context = wx.createCameraContext()
 
       this.setData({
           wx: Object.keys(context)
       })

测试输出结果:

1 回复

麻烦提供这种格式的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

另外,扫描下图贴一下截图

回到顶部