请问现在是否有进展
video组件,android系统,MP4播放不了,转了码率就可以,IOS可以播放https://ali-ky.video.yximgs.com/mediacloud/suo/suo_video/ZXtJ_AUsGm3uHHOpZu-tv4b76MkMOW3OkZbDUEKjSWM.mp4 该视频码率为512kb/s,提高码率后video可以在android上正常播放。该视频在微信会话中能正常访问。 [图片]
2020-08-14这个后面定义了x和y,从有滑动的点开始,重新设置width和height,尽量减少width和height,减少右移次数,完成需求的。
安卓手机用canvasToTempFilePath提示exceed size limit使用canvas2d的方法,安卓手机vivo z5x 红米note8 pro等用canvasToTempFilePath生成图片提示canvasToTempFilePath:fail:convert native buffer parameter fail. native buffer exceed size limit,初步怀疑是宽度设置太大原因,设置了180vw。 <canvas id="canvas" canvas-id="signCanvas" type="2d" binderror="drawError" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="width:{{width}}vw;height:100%;border:1px solid #ddd;margin:auto;margin-left:{{marginLeft}}vw;"> </canvas> data: { marginLeft: 0, width: 180, demoSrc: '', title: '', isShowCanvas: true, // 默认一开始只有一个页面 isOnlyOnePage: true }, init(res) { console.log(res) const width = res[0].width const height = res[0].height const canvas = res[0].node console.log('初始化宽高度', width, height) canvasWidth = width; canvasHeight = height signCanvas = canvas.getContext('2d') canvas.width = width * dpr canvas.height = height * dpr canvasObj = canvas signCanvas.scale(dpr, dpr) signCanvas.lineWidth = 8; signCanvas.lineCap = "round"; signCanvas.strokeStyle = "#222222"; }, // 保存确定 saveSign() { let that = this; let canHeight = 90; let canWidth = this.data.width; if (handData.length) { console.log('canvas宽高', canvasWidth, canvasHeight) console.log('dest图片宽度高度', canWidth, canHeight) wx.canvasToTempFilePath({ x: 0, y: 0, destHeight: canHeight, destWidth: canWidth, canvas: canvasObj, success: function (res) { console.log('res', res) that.setData({ demoSrc: res.tempFilePath }) wx.downloadFile({ url: res.tempFilePath, success: (res) => { console.log(res) }, fail: (err) => { console.log(err) } }) }, fail: function (err) { console.log('生成图片失败', err) if (err && err.errMsg.indexOf('native buffer exceed size limit') >= 0) { util.showModel('生成图片失败', '生成图片过大,请重新进入该页面,减少签名文字大小,降低右移次数') } else if (err && err.errMsg) { util.showModel('生成图片失败', err.errMsg) } else { util.showModel('生成图片失败', '请重新打开页面签名') } } }) } }
2020-06-17