Safari和Firefox中的HTML5视频(mp4和ogv)问题 - 但是Chrome都很好 [英] HTML5 video (mp4 and ogv) problems in Safari and Firefox - but Chrome is all good

查看:195
本文介绍了Safari和Firefox中的HTML5视频(mp4和ogv)问题 - 但是Chrome都很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

I have the following code:

<video width="640" height="360" controls id="video-player" poster="/movies/poster.png">
 <source src="/movies/640x360.m4v" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
 <source src="/movies/640x360.ogv" type='video/ogg; codecs="theora, vorbis"'> 
</video>




  • 我正在使用Rails(Mongrel开发和Mongrel + Apache制作)。
  • 无论是在本地还是从我的制作服务器,Chrome(Mac和Win)都可以播放任一文件(由其他源标记进行测试)。

  • Safari(Mac和Win)可以在本地播放mp4文件,但不能从制作文件中播放。

  • Firefox 3.6不会在任何一个操作系统中播放视频。我只是在视频播放器区域中间出现了一个灰色十字。

  • 我确定Mongrel和Apache在每种情况下都有正确的MIME类型集。

  • 从Chrome的搜索结果中,我知道我的视频文件或文件被要求或交付的方式本质上没有任何问题。

    • I'm using Rails (Mongrel in development and Mongrel+Apache in production).
    • Chrome (Mac and Win) can play either file (tested by one then the other source tags) whether locally or from my production servers.
    • Safari (Mac and Win) can play the mp4 file fine locally but not from production.
    • Firefox 3.6 won't play the video in either OS. I just get a grey cross in the middle of the video player area.
    • I've made sure that both Mongrel and Apache in each case have the right MIME types set.
    • From Chrome's results I know there is nothing inherently wrong with my video files or the way the files are being asked for or delivered.
    • 对于Firefox,我查看了 https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox 它指的是一个错误事件和一个错误属性。看起来这个错误事件是很直接的,当时没有错误属性。有谁知道如何诊断问题?

      For Firefox I looked at https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox where it refers to an 'error' event and an 'error' attribute. It seems the 'error' event is thrown pretty well straightaway and at that time there is no error attribute. Does anyone know how to diagnose the problem?

      推荐答案

      .ogg的HTTP内容类型应该是application / ogg(video / ogg for .ogv)和.mp4它应该是视频/ MP4。您可以使用网络嗅探器进行检查。

      The HTTP Content-Type for .ogg should be application/ogg (video/ogg for .ogv) and for .mp4 it should be video/mp4. You can check using the Web Sniffer.

      这篇关于Safari和Firefox中的HTML5视频(mp4和ogv)问题 - 但是Chrome都很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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