HTML5 video (mp4 and ogv) problems in Safari and Firefox - but Chrome is all good

前端 未结 6 850
走了就别回头了
走了就别回头了 2020-11-28 08:19

I have the following code:

相关标签:
6条回答
  • 2020-11-28 08:22

    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.

    0 讨论(0)
  • 2020-11-28 08:27

    Just remove the inner quotes - they confuse Firefox. You can just use "video/ogg; codecs=theora,vorbis".

    Also, that markup works in my Minefiled 3.7a5pre, so if your ogv file doesn't play, it may be a bogus file. How did you create it? You might want to register a bug with Firefox.

    0 讨论(0)
  • 2020-11-28 08:37

    I see in the documentation page an example like this:

    <source src="foo.ogg" type="video/ogg; codecs=&quot;dirac, speex&quot;">
    

    Maybe you should enclose the codec information with &quot; entities instead of actual quotes and the type attribute with quotes instead of apostrophes.

    You can also try removing the codec info altogether.

    0 讨论(0)
  • 2020-11-28 08:41

    Incidentally, .ogv files are video, so "video/ogg", .ogg files are Vorbis audio, so "audio/ogg" and .oga files are general Ogg audio, so also "audio/ogg". Checked in Firefox and work. "application/ogg" is deprecated for all audio or video uses. See http://www.rfc-editor.org/rfc/rfc5334.txt

    0 讨论(0)
  • 2020-11-28 08:43

    Add these lines in your .htaccess file and it will work for all browsers. Works for me.

    AddType video/ogg .ogv
    AddType video/mp4 .mp4
    AddType video/webm .webm
    

    If you dun have .htaccess file in your site then create new one :) its obvious i guess.

    0 讨论(0)
  • 2020-11-28 08:46

    Just need to change one letter:), rename 640x360.ogv to 640x360.ogg, it will work for all the 3 browers.

    0 讨论(0)
提交回复
热议问题