beauty="1"
whiteness="2"
aspect="1:1"
local-mirror=""
@statechange="statechange"
@netstatus="netstatus"
@error="error"
</live-pusher>
onReady() {
this.context = uni.createLivePusherContext("livePusher", this)
},
onShow() {
this.$nextTick(() => {
setTimeout(() => {
this.startPreview()
}, 10)
})
},
this.context.startPreview({
success: (a) => {
// 用户拒绝和允许都会走success,打印结果为{"errMsg":"startPreview:ok"}
console.log("livePusher.switchCamera:" + JSON.stringify(a));
this.checkOpenPermission()
},
fail: (e) => {
console.log(e)
}
});