html ::before css
给指定Id为video添加对应::before的css
var style1 = document.createElement('style');
style1.innerHTML = `#video::before { content: ""; display: inline-block; background-image:url(${img}); background-size: cover;}`;
document.head.appendChild(style1);