HTML5视频播放 - 图像预加载 [英] HTML5 Video Playback - image preload

查看:651
本文介绍了HTML5视频播放 - 图像预加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用视频标签和jQuery来显示HTML5视频播放。

I am using video tags and jQuery to display a HTML5 video playback.

如何在视频加载显示时显示图像?

How can I show an image while the video is still loading for displaying?

我会为此使用jQuery ..

I would use jQuery for this..

提前致谢!

PD:视频预加载时显示图像。

PD: Display an image when the video preloads.

推荐答案

JQuery无需实现此目的html5视频标签带有自己的海报属性。您可以使用它来指定视频加载时应显示的图像。例如,如果你有一个名为 myImage.jpg 的图像,你可以执行以下操作:< video controls =controlsposter =myImage.jpg > 。有关详细信息,请参阅此处:

There is no need for JQuery to achieve this as the html5 video tag comes with its own poster attribute. You can use that to specify what image should be displayed while the video loads. For instance if you have an image called myImage.jpg you can do the following: <video controls="controls" poster="myImage.jpg">. Refer here for more info:

https://www.w3.org/wiki/HTML/Elements/video#HTML_Attributes

这篇关于HTML5视频播放 - 图像预加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆