视频无法在浏览器中播放 [英] Videos not playing in browsers

查看:332
本文介绍了视频无法在浏览器中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有6种不同类型的视频格式,即 .avi .mkv .mov .ogv .wmv .mp4 。我尝试使用HTML5中的视频标记将这些视频嵌入到浏览器中。但在任何浏览器中都没有播放视频。在 Firefox 中,它显示没有支持mime类型的视频。在 Chrome 中,仅播放.mp4视频,其余视频均未播放。在 IE8 中,它什么都没有显示。这是我的HTML代码:

I am having 6 different types of video formats, namely .avi, .mkv, .mov, .ogv, .wmv, .mp4. I tried to embed these videos to the browsers using video tag in HTML5. But no videos played in any browsers. In Firefox it shows "no video with supported mime type". In Chrome only .mp4 video is playing rest of the videos are not playing. In IE8 it shows nothing. Here is my HTML code:

<video width="300" height="200" controls>
    <source src="videos/airhorse_avi.avi" type="video/avi" title="Avi Videos">
</video>
<video width="300" height="200" controls>
    <source src="videos/airhorse_mkv.mkv" type="video/mkv" title="Mkv Videos">
</video>
<video width="300" height="200" controls>
    <source src="videos/airhorse_mov.mov" type="video/mov" title="Mov Videos">
</video>
<video width="300" height="200" controls>
    <source src="videos/airhorse_ogv.ogv" type="video/ogv" title="Ogv Videos">
</video>
<video width="300" height="200" controls>
    <source src="videos/airhorse_wmv.wmv" type="video/wmv" title="Wmv Videos">
</video>
<video width="300" height="200" controls>
    <source src="videos/spielberg_mp4.mp4" type="video/mp4" title="Mp4 Videos">
</video>

可以在任何浏览器中播放所有这些视频,例如firefox,chrome,IE,safari,opera 。

Is that possible of playing all these videos in any browsers like firefox, chrome, IE, safari, opera.

推荐答案

简单的答案是,由于各种原因,并非所有浏览器都支持所有可用的编解码器/容器。

The simple answer is that for various reasons not all browsers support all the available codecs/containers.

这里有一个相当新的列表 http:/ /en.wikipedia.org/wiki/HTML5_video
,这个答案显示了如何自己测试特定支持针对网站特定部分的移动检测

There is a fairly up-to-date list here http://en.wikipedia.org/wiki/HTML5_video and this answer shows how you can test specific support yourself Mobile detection for specific parts of websites

您提及(在其中一条评论中)你得到一个错误...如果你让我们知道是什么错误(如果 canPlayType()没有回答问题)那么我们可以研究更多

You mention (in one of the comments) that you get an error thrown ... if you let us know what error that is (if the canPlayType() doesn't answer the question) then we could research some more

这篇关于视频无法在浏览器中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆