IE9 使用视频缩略图覆盖 HTML5 视频的海报属性
我想使用自定义海报图像,虽然这可以在所有好的浏览器中使用,但愚蠢的 IE9 会显示它几毫秒,然后加载视频的缩略图。有没有任何属性或其他方法可以防止这种情况?
I want to use a custom poster image, and while this works and all the good browsers, stupid IE9 displays it for a few milliseconds, and then loads a thumbnail of the video. Is there any attribute or other way to prevent this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先:IE 的行为很愚蠢,但根据 HTML5 规范是正确的(不再是了?)。如果你想责怪某人,你应该责怪Apple/Quicktime,因为,他们已经要求能够删除海报属性,如果视频的元数据被加载(你可以在带有旧版Quciktime插件的Safari4中看到这种行为)。现在,Chrome 和 Safari 已经纠正了他们的行为,然后他们改变了规范(很好的举动)。
是的,您可以通过使用解决方法来更改此行为,只需在视频元素上使用 preload="none" 即可:
First of all: IE behavior is stupid, but was correct according to the HTML5 specification (not anymore?). If you want to blame someone, you should blame Apple/Quicktime, because, they have requested to be able to drop the poster attribute, if video's metadata is loaded (You can see this behavior in Safari4 with older Quciktime plugin). Now, Chrome and Safari have corrected thier behavior and then they changed spec (Nice move).
Yes you can change this behavior by using a workaround, simply use preload="none" on your video element:
preload="none"
似乎解决了 IE9 中海报丢失的问题,但它实际上禁用了 Opera 中的控件 - 因为视频进度条指示器在播放时仍保留在视频的开头。不是一个大问题,只是它确实发生了。想知道是否有一个脚本可以在 IE 中启用
preload="none"
,并在所有其他浏览器中启用preload="auto"
。preload="none"
seems to solve the missing poster problem in IE9, however it effectively disables controls in Opera - in that the video progress bar indicator remains at the beginning of the video while it is playing.Not a huge issue, except that it happens. Would like to know if there is a script to enable
preload="none"
in IE, and havepreload="auto"
in all other browsers.请参阅我的 IE9 中海报问题的解决方案:
http://www.artbymikeshaffer.com/vids/finalproject_chetbakerquartet_poster7 .html
一些简单的 CSS 和条件语句就达到了目的。我现在认为海报应该放置在视频的开头(第一帧)和结尾(最后一帧),就像专辑封面一样。通过这种方式,视频开头和结尾的图像将为观看者提供一些关于为什么他们应该播放视频的视觉想法(就像您有时购买专辑的原因是因为封面一样)。
我的两分钱值,
干杯
See my solution for the poster issue in IE9:
http://www.artbymikeshaffer.com/vids/finalproject_chetbakerquartet_poster7.html
Some simple CSS and conditional statements did the trick. I'm now of the opinion posters should be placed at the beginning (first frame) and end (last frame) of a video, as if they were album covers. In this way, an image at the beginning and end of the video will give the view SOME visual idea of why they should play the video (just like the reason you buy an album sometimes is because of the cover).
My two cent's worth,
Cheers