livePusher: null, //流视频对象 snapshotsrc: null //快照 }; }, onLoad(e) { _this = this; if (e.dotype != undefined) this.dotype = e.dotype; this.initCamera(); }, onReady() { this.livePusher = uni.createLivePusherContext('livePusher', this); this.startPreview(); //开启预览...
在微信开发者工具上就是打印不出来拍不了照 得账号申请live-pusher权限后 真机调试才行 ...
camerastate: false, //相机准备好了 livePusher: null, //流视频对象 snapshotsrc: null //快照 }; }, onLoad(e) { _this = this; this.initCamera(); }, onReady() { this.livePusher = uni.createLivePusherContext('livePusher', this); this.startPreview(); //开启预览并设置摄像头 this.poe...
this.livePusher.snapshot({ success: e => { _this.snapshotsrc = e.message.tempImagePath; console.log('抓拍', e, e.message.tempImagePath); // 打印结果 仅供参考 //{ // "message": { // "height": 1857, // "width": 1080, // "tempImagePath": "/storage/emulated/0/Android/data/...
snapshotsrc: null, //快照 }; }, onLoad(e) { _this = this; this.initCamera(); }, onReady() { this.livePusher = uni.createLivePusherContext('livePusher', this); this.startPreview(); //开启预览并设置摄像头 this.poenCarme(); ...
data() {return{//提示message: '',//相机画面宽度cameraWidth: '',//相机画面宽度cameraHeight: '',//屏幕可用宽度windowWidth: '',//屏幕可用高度windowHeight: '',//流视频对象livePusher:null,//照片snapshotsrc:null,//倒计时second: 0,
// 拍照并添加水印 async snapshotWithWatermark() { const livePusher = uni.createLivePusherContext('livePusher', this); try { const tempImagePath = await new Promise((resolve, reject) => { livePusher.snapshot({ success: (res) => { resolve(res.tempImagePath); }, fail: (err) ...
//相机准备好了 livePusher: null, //流视频对象 snapshotsrc: null //快照 }; }, onLoad(e) { _this = this; this.dotype = e.dotype; this.initCamera(); }, onReady() { this.livePusher = uni.createLivePusherContext('livePusher', this); this.startPreview(); //开启预览并设置摄像头 ...
请问您这边解决了不
image></view></view></template>let_this =null;exportdefault{data() {return{poenCarmeInterval:null,//打开相机的轮询aspect:'2:3',//比例windowWidth:'',//屏幕可用宽度windowHeight:'',//屏幕可用高度camerastate:false,//相机准备好了livePusher:null,//流视频对象snapshotsrc:null,//快照}; },onLoa...