如何将加载器图像添加到HTML5视频? [英] How to add loader image to HTML5 video?

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

问题描述

与海报图片一起,我希望在下载视频时显示加载程序图像(动画gif)。怎么可能?

Along with the poster image I want a loader image(an animated gif) to be displayed while the video is being downloaded. How is it possible ?

推荐答案

一个便宜的方法是在海报中使用动画GIF 属性,当视频开始播放时将被替换。例如:

A cheap way could be to use an animated GIF in the poster attribute which will be replaced when the video begins to play. Example:

<video poster="loading.gif" preload="auto" controls autoplay>
   <source type="video/mp4" src="video.mp4"/>
</video>

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

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