HTML5 视频/视频海报的结尾 [英] HTML5 Video / End of a Video Poster

查看:29
本文介绍了HTML5 视频/视频海报的结尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<video controls="controls" poster="http://gifs.gifbin.com/1233925271_8be9acc.gif" style="width:800px;">

同上;在 HTML5 标签中,我可以添加海报;图像或动画 .gif 就好了,并在播放"实际视频之前播放/运行.

With the above; within the HTML5 <video> tag, I can add a poster; of an image or animated .gif just fine and plays / runs before the actual video is 'played'.

现在,我如何添加图像;特别是将在视频播放完毕后运行的 .gif(动画 .gif 与海报一起使用)?

NOW, how can I add an image; specifically a .gif (animated .gif works with poster) that will run AFTER the video has played through?

推荐答案

简而言之:你需要的是添加 video.addEventListener('ended',function() {}) 并在您的自定义 JavaScript 中触发 video.load().

In short: what you need is to add video.addEventListener('ended',function() {}) and trigger video.load() in your custom JavaScript.

这是一个播放完视频后重定向的相关帖子,您可以相应地对其进行修改 - 播放后重定向 html5 视频.

Here is a related post that redirects after video is played, you may modify it accordingly - Redirect html5 video after play.

参考资料以查找详细信息:

这篇关于HTML5 视频/视频海报的结尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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