不使用Flash的全屏视频背景
有没有办法不使用Flash而为网页设置全屏视频背景?
我正在考虑 html5,但我不能将 Internet Explorer 排除在外。
有什么想法吗?
多谢
Is there any way to set a full screen video background for a web page without using Flash?
I was considering html5 but I cannot leave Internet Explorer out.
Any ideas?
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您需要支持 IE 8 及更早版本,并且想要避免 Flash,那么您可以在 Silverlight 中构建一个关于 HTML5 的视频播放器,正如其他人提到的,它不允许全屏播放,最好它提供全屏播放窗口播放。
希望这会有所帮助,但我想如果您试图避免使用 Flash,那么您实际上是在避免使用插件。
If you need to support IE versions 8 and earlier, and want to avoid Flash, then you could build a video player in Silverlight, concerning HTML5, as the other people mention, it does not allow full screen playback, the best it offers it full window playback.
Hope that helps, but I imagine that if you're trying to avoid Flash then you're actually avoiding using plugins.
看来你可以。请参阅此问题。并查看 VideoBG jQuery 插件。相当滞后,并且浏览器支持不是很好,但它确实有效:)
Seems you can. See this question. And check out the VideoBG jQuery plugin. Rather laggy, and not great browser support, but it does work :)
如果您的意思是真正全屏 - 占据整个,物理屏幕 - 不。没有现代浏览器允许在纯 HTML 中执行此操作。
If you mean true fullscreen - occupying the whole, physical screen - nope. No modern browser allows this in pure HTML.
如果不使用 Internet Explorer 安装额外的附加组件或对象,这是不可能的。
HTML5
允许在您的网站中嵌入视频,但并非所有浏览器都提供全屏支持。也许是使用 Google 的 Chrome Frame 一个想法。查看
HTML5
规范:也可以嵌入 Microsoft 的 Windows Media Player,但不能在后台...这是一个工作示例: http://www.html5-fullscreen-video.com/
It is not possible without installing additional add ons or objects with internet explorer.
HTML5
allows to embed videos in your website, but not all browser provide full-screen support for that. Maybe is to use Google's Chrome Frame an idea.Have a look at the
HTML5
specification:It is also possible to embed Microsoft's Windows Media Player, but not in background... Here a working example: http://www.html5-fullscreen-video.com/
我认为你需要首先确定为什么你不热衷于使用Flash。如果原因是您想要定位移动设备,那么将 HTML5 的
与 Flash 播放器回退结合使用绝对是可行的。
不幸的是,并非所有浏览器都完全支持 HTML5,尤其是 IE。这可能就是您在某些时候仍然需要使用 Flash 的原因。
因此,假设您想为全屏背景视频使用“HTML5 的
+ Flash Fallback”方法,您可能会执行以下操作:
HTML:
然后对其进行样式设置像这样的全屏效果和比例裁剪/拉伸:
I think that you need to first establish why you are not keen on using Flash. If the reason is that you want to target mobile devices, then using HTML5's
<video>
in combination with a Flash player fall back is definitely viable.Unfortunately HTML5 is not fully supported in every browser - especially IE. This is probably why you will still need to use Flash at some point.
So assuming that you would like to give the "HTML5's
<video>
+ Flash fallback" method a shot for your full screen background video, here's what you could probably do:HTML:
And then you style it like this for a full screen effect and proportional cropping/stretching:
好吧,如果它只是一个简短的动画/视频,你可以做一个精灵动画,但我很确定性能不会令人满意。更不用说图像尺寸了
Well you COULD do a sprite animation if it's just a short animation/video but i'm pretty sure the performance wouldn't be satisfactory. not to mention the image size