收藏
回答

Camera组件拍照录像无法实现

使用wx.createCameraContext()的takePhoto()和startRecord()方法均没有结果回调。tap事件已经触发了的,wx.canIUse()也返回成功。

测试机为iphone7(iOS11.0.3 微信版本6.5.18 基础库版本1.6.0)

部分代码如下:

<camera binderror='bindError' >

</camera>

<button bindtap='bindPhoto'>拍照</button>


var camera = wx.createCameraContext();


Page({

    bindPhoto() {
        console.log('canuse:' + wx.canIUse('createCameraContext'));
        camera.takePhoto({
            success(res) {
                console.log(res)
            },
            fail(e) {
                app.console(e);
            }
        });
    }

})



回答关注问题邀请回答
收藏
登录 后发表内容