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/...
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权限后 真机调试才行 ...
console.log("livePusher.close:" + JSON.stringify(a)); } }); }, snapshot: function() { this.context.snapshot({ success: (e) => { console.log(JSON.stringify(e)); } }); }, resume: function() { this.context.resume({ success: (a) => { console.log("livePusher.resume:" + JS...
('livePusher.close:'+JSON.stringify(a));}});},snapshot(){this.context.snapshot({success:e=>{console.log(JSON.stringify(e));}});},resume(){this.context.resume({success:a=>{console.log('livePusher.resume:'+JSON.stringify(a));}});},pause(){this.context.pause({success:a=>{...
console.log("livePusher.startPreview:" + JSON.stringify(a)); that.Timer = setInterval(function(){ that.snapshot() if(that.imgList.length>3){ console.log("3") clearInterval(that.Timer) } },2000) } }); }, // 使用plus.zip.compressImage压缩图片并转换成base64 ...
// 拍照并添加水印 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) ...
},//抓拍snapshot() {//震动uni.vibrateShort({success:function() {console.log('success'); } });//拍照this.livePusher.snapshot({success:e=>{ _this.snapshotsrc= e.message.tempImagePath; _this.stopPreview(); _this.setImage(); uni.navigateBack(); ...
{ //拍照 this.snapshot() } }, //抓拍 snapshot() { let that = this this.livePusher.snapshot({ success(res) { that.snapshotsrc = res.message.tempImagePath; that.uploadingImg(res.message.tempImagePath) } }); }, // 倒计时 getCount() { this.second = 5 let timer = setInterval(...
//相机准备好了 livePusher: null, //流视频对象 snapshotsrc: null //快照 }; }, onLoad(e) { _this = this; this.dotype = e.dotype; this.initCamera(); }, onReady() { this.livePusher = uni.createLivePusherContext('livePusher', this); this.startPreview(); //开启预览并设置摄像头 ...