Do html 5 videos buffer on page load or only when playing the video?

时光总嘲笑我的痴心妄想 提交于 2020-01-02 05:33:25

问题


If I wanted to embed 20 videos on a page will they all start buffering on page load or will they wait until they are played/interacted with for the first time? If they buffer on load how could I circumvent this until I want to display the video? I don't want a user to be buffering 20 videos when they may only be watching one or even none at all.


回答1:


You are looking at the preload attribute of HTML5 video tag. Here is the doc. Basically there are three options :

 auto - when browser should load the entire video when the page loads
 metadata - when browser should load only metadata when the page loads
 none - when browser should NOT load the video when the page loads


来源:https://stackoverflow.com/questions/21790012/do-html-5-videos-buffer-on-page-load-or-only-when-playing-the-video

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!