如何在HTML5视频上设置缩略图? [英] How to set the thumbnail image on HTML5 video?
本文介绍了如何在HTML5视频上设置缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在HTML5视频上设置缩略图?
我想在玩前看到一些图片。
我的代码如下:
Is there a way to set thumbnail image on HTML5 video? I want to see some pictures before play. My code looks like this:
<video width="470" height="255" controls>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
<source src="video.webm" type="video/webm">
<object data="video.mp4" width="470" height="255">
<embed src="video.swf" width="470" height="255">
</object>
</video>
$ b
谢谢!
Thanks!
推荐答案
将 poster =placeholder.png
添加到视频标签。
<video width="470" height="255" poster="placeholder.png" controls>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
<source src="video.webm" type="video/webm">
<object data="video.mp4" width="470" height="255">
<embed src="video.swf" width="470" height="255">
</object>
</video>
这是否有效?
这篇关于如何在HTML5视频上设置缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文