[英]html5 video tag displays an empty video box when no video is uploaded. How can I hide this empty box?
[英]How can I add a empty attribute to my video tag?
我只想使用javascript将'autobuffer'属性添加到我的视频代码中。
基本上:
var video = document.createElement('video');
video.addAttribute('autoBuffer');
我将拥有:
<video autoBuffer></video>
我试过了:
video.setAttribute('autoBuffer'); => <video autoBuffer="undefined"></video>
哪有错
setAttribute
的第二个参数必须始终为字符串-当前,您隐式传递的undefined
将转换为一个。 使用
video.setAttribute('autoBuffer', '');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.