HTML5视频自动播放无法正常工作 [英] HTML5 Video Autoplay not working correctly
问题描述
我正在使用此代码:
<video width="440px" loop="true" autoplay="true" controls>
<source src="http://www.tuscorlloyds.com/CorporateVideo.mp4" type="video/mp4" />
<source src="http://www.tuscorlloyds.com/CorporateVideo.ogv" type="video/ogv" />
<source src="http://www.tuscorlloyds.com/CorporateVideo.webm" type="video/webm" />
</video>
我想让视频自动播放但是当页面加载时视频无法播放,它看起来像是一个缓冲问题,当我将鼠标悬停在视频上时(显示控件)视频总是在2秒内停止然后停止并且不会继续。
I want the video to autoplay but when the page loads the video doesnt play, it looks like its a buffering issue as when I hover on the video (to show controls) the video is always 2seconds in but then stops and doesnt continue.
页面可以在这里看到: http://www.tuscorlloyds.com (视频在右上方的滑块中)
Page can bee seen here: http://www.tuscorlloyds.com (video is in slider top right)
注意:我刚刚再次访问该网站并且autopplay似乎有效,但是当我再次尝试同样的问题时,这是一个缓冲问题吗?我能做些什么来阻止这个?
Note: I just visited the site again and autopplay seemed to work but when I try again the same issue is happening, is this a buffering issue? Anything I can do to stop this?
非常感谢
缺席
Many Thanks nick
推荐答案
尝试 autoplay =autoplay
而不是true
值。这是记录的启用自动播放的方法。我知道这听起来很奇怪。
Try autoplay="autoplay"
instead of the "true"
value. That's the documented way to enable autoplay. That sounds weirdly redundant, I know.
这篇关于HTML5视频自动播放无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!