![](/img/trans.png)
[英]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.