内嵌视频 HTML
我不知道为什么这不起作用。
<video src="American.avi" controls="controls">
<object data="American.avi" type="video/avi" />
<embed src="American.avi" />
上述所有标签都返回“缺少插件”或具有不加载视频的视频控件。 Chrome 上没有安装缺少插件的链接,Firefox 上有,但它说找不到合适的插件。
有什么建议吗?
I have no idea why this isnt working.
<video src="American.avi" controls="controls">
<object data="American.avi" type="video/avi" />
<embed src="American.avi" />
All of the above tags return either "Missing Plugin" or have video controls that dont load a video. There is no link to install the missing plugin on chrome, there is on Firefox but it says no suitable plugins were found.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想确保跨浏览器的广泛兼容性,那么我相信使用 HTML5 标签嵌入视频的建议方法如下;
AVI 是一种视频容器,可以包含多种格式之一的视频。因此,我认为最好将视频转换为 .ogg 和 .mp4 格式,以确保在各种浏览器之间的兼容性。
为了澄清,上面的代码将显示一个视频播放器,它将使用任何一种提供的源方法(但只有一种)。因此,您可以为给定的视频窗口提供多种格式,浏览器将选择它可以显示的源元素并显示它。因此,使用上面的代码,如果浏览器可以播放该文件的 .ogg 版本,它就会播放,否则它将尝试播放 .mp4 文件。
If you are trying to ensure a wide range of compatibility across browsers, then I believe the suggested method of embedding video using HTML5 tags is as follows;
AVI is a video container, and could contain video in one of a wide variety of formats. As such, I believe it's preferable if you can convert your video to .ogg and .mp4 formats to ensure compatibility across a wide range of browsers.
To clarify, the above code will show a single video player which will use any one of the provided source methods (but only one). So you can provide multiple formats for a given video window and the browser will pick which of the source elements that it can display and it will display that. So, with the above code, if the browser can play the .ogg version of the file it will, otherwise it will try to play the .mp4 file instead.
浏览器通常不支持 AVI。您所拥有的容器和编解码器的选择是有限的,部分是故意的(因为多种格式意味着大量潜在的安全漏洞),部分是由于软件专利等不幸的限制。
要获得跨浏览器兼容的
,您需要提供 MP4 和 WebM 或 OGG Theora 之一。您还可以在 Flash 播放器中使用 MP4 视频作为不支持
的浏览器的后备方案。
请参阅此表了解哪些浏览器支持哪些格式。
Browsers generally don't support AVI. The choice of containers and codecs you have is limited, partly deliberately (because lots of formats means lots of potential security holes) and partly due to unfortunate limitations like software patents.
To get cross-browser-compatible
<video>
you will need to provide MP4 and one of WebM or OGG Theora. You can also use the MP4 video in a Flash player as a fallback for browsers that don't support<video>
.See this table for which browsers support which formats.