Camera组件拍照录像无法实现
发布于 6 年前 作者 yan04 1854 次浏览 来自 问答

使用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);
            }
        });
    }

})


回到顶部