1.开启canvas透明权限,并且设置透明度为0
cc.macro.ENABLE_TRANSPARENT_CANVAS = true;
cc.director.setClearColor(new cc.Color(0,0,0, 0));
2. 设置canvas和video 标签层级
initVideoZIndex: function () {
let video0 = document.getElementsByClassName('cocosVideo')[0];
video0.style.zIndex = 5;
video0.setAttribute("x5-video-player-type", "h5");
video0.setAttribute("webkit-playsinline", true);
video0.setAttribute("x-webkit-airplay", true);
video0.setAttribute("x5-video-orientation", "h5");
video0.setAttribute("preload", "auto");
let gCanvas = document.getElementsByClassName('gameCanvas')[0];
gCanvas.style.position = 'relative';
gCanvas.style.zIndex = 10;
},