Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用视频标签和 jQuery 来显示 HTML5 视频播放。
如何在视频仍在加载显示时显示图像?
我会为此使用jQuery..
提前致谢!
PD:视频预加载时显示图像。
JQuery 没有必要实现这一点,因为 html5 视频标签带有自己的海报属性。您可以使用它来指定在视频加载时应显示的图像。例如,如果您有一个名为的图像,myImage.jpg您可以执行以下操作:<video controls="controls" poster="myImage.jpg">. 请参阅此处了解更多信息:
myImage.jpg
<video controls="controls" poster="myImage.jpg">
https://www.w3.org/wiki/HTML/Elements/video#HTML_Attributes