Html chrome 中的 HTML5 视频标签 - wmv

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2425218/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:28:12  来源:igfitidea点击:

HTML5 video tag in chrome - wmv

videohtmlgoogle-chrome

提问by elcuco

I need to make a page which displays a video. Firefox and and Opera support the OGG format, no problem there. Chrome is ... "stupid" and does not recognize OGG.

我需要制作一个显示视频的页面。Firefox 和 Opera 支持 OGG 格式,没问题。Chrome 是……“愚蠢的”,无法识别 OGG。

Does Chrome on Windows know how to handle WMV? I already have them encoded, and no I cannot recode new videos since the media is limited in spaced (CDROM).

Windows 上的 Chrome 是否知道如何处理 WMV?我已经对它们进行了编码,不,我无法重新编码新视频,因为媒体的空间有限(CDROM)。

My code currently looks like this (and not working in chrome)

我的代码目前看起来像这样(并且不适用于 Chrome)

<video controls>
<source codecs="theora, vorbis" media="video/ogg" src="video.ogv" />
<source media="video/x-ms-wmv" src="video.wmv" />
Please install a new browser, or just get out
</video>

Note that I am missing a codec entry, does anyone know what I need to put there?

请注意,我缺少一个编解码器条目,有人知道我需要在那里放什么吗?

回答by foolip

To the best of my knowledge, Chrome doesn't support WMV. Opera, Firefox and Chrome support Ogg Theora+Vorbis, while Chrome and Safari support MPEG-4 H.264+AAC.

据我所知,Chrome 不支持 WMV。Opera、Firefox 和 Chrome 支持 Ogg Theora+Vorbis,而 Chrome 和 Safari 支持 MPEG-4 H.264+AAC。

Your markup needs a bit of fixing. There is no codecs attribute, use the type attribute instead. Also, you usually don't need the media attribute at all. Here's your cleaned up markup:

您的标记需要一些修复。没有 codecs 属性,请改用 type 属性。此外,您通常根本不需要 media 属性。这是您清理的标记:

<video controls>
  <source type="video/ogg; codecs=theora,vorbis" src="video.ogv">
  <source src="video.wmv">
  Your browser doesn't support video, you may download the
  video instead: <a href="video.ogv">Ogg</a>
</video>

The only browser that might be able to play WMV is Opera on Linux (if you happen to have the right GStreamer plugins installed). That's not very useful, so you should probably just not use WMV with <video> at all.

唯一能够播放 WMV 的浏览器是 Linux 上的 Opera(如果您碰巧安装了正确的 GStreamer 插件)。这不是很有用,因此您可能根本不应该将 WMV 与 <video> 一起使用。

You might find this useful reading: Everything you need to know about HTML5 video and audio.

您可能会发现这篇有用的阅读材料:您需要了解的有关 HTML5 视频和音频的所有信息

Disclaimer: I work on <video> for Opera.

免责声明:我为 Opera 制作 <video>。

回答by Rob

Chrome handles wmv with a plugin, but not with a codec in HTML5. Chrome and HTML5 handles H.264.

Chrome 使用插件处理 wmv,但不使用 HTML5 中的编解码器。Chrome 和 HTML5 处理 H.264。