HTML5 视频缓冲区
我有一个视频,我想在用户单击按钮时显示该视频。我使用 jQuery .append()
将视频代码添加到页面。
我已设置自动播放
,目前,视频首先开始仅播放音频,然后过了一会儿,又从头开始播放音频和视频。
有什么办法可以防止这种故障的发生吗?
提前致谢!
I have a video that I want to show when the user clicks on a button. I add the video code to the page using jQuery .append()
.
I've set autoplay
and currently, the video first starts to play with audio only, and then after a while, starts again from the beginning with audio and video.
Is there a way I could prevent this glitch from happening?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题。 jQuery 正在创建您的视频元素,并在将其附加到页面之前开始播放(在后台)。当使用 .html() 而不是 .append() 制作元素时,似乎不会发生这种情况: http: //jsfiddle.net/cDpV9/6/
I had the same issue. jQuery is creating your video element and it starts playing (in the background) before it appends it to the page. It doesn't seem to happen when making the element with .html() instead of .append(): http://jsfiddle.net/cDpV9/6/