<video id="bsVideo" :controls="false" style="width: 100%;">
<canvas style="width: 100%;height: 100px;" canvas-id="bsCanvas" id="bsCanvas"></canvas>
</video>
methods: {
play() {
const videoContext = uni.createVideoContext('bsVideo', this);
videoContext.requestFullScreen({direction: 0});
var ctx = uni.createCanvasContext('bsCanvas', this)
ctx.setFillStyle('red')
ctx.fillRect(10, 10, 150, 75)
ctx.draw()
}
}
1 个回复
1***@qq.com (作者)
解决方案:使用条件编译,直接用新版微信小程序canvas 2d接口可以解决,与同层渲染有关,等待uniapp接口适配