【问题标题】:HTML5 Video not working in IE or Firefox, fine in ChromeHTML5 视频在 IE 或 Firefox 中不起作用,在 Chrome 中正常
【发布时间】:2014-01-25 20:29:00
【问题描述】:

所以我有 3 个不同版本的视频,mp4、ogg 和 webm。在谷歌浏览器中,视频工作正常。在 IE 和 Firefox 中,我收到一条消息说它找不到正确的文件或路径。

这是 HTML:

    <video class="center" controls>
    <source src="AlderneyBunkerParty2013.mp4" type="video/mp4">
    <source src="AlderneyBunkerParty2013.ogg" type="video/ogg">
    <source src="AlderneyBunkerParty2013.webm" type="video/webm">
    Your browser does not support the video tag.
    </video>

如果您想看看,该网站是 www.alderneybunkerparties.co.uk。我正在运行最新版本的 Firefox 和 IE 11。我还在我的 html 中包含了一个 shim。

我已经读到可以只用 .ogg 或 .webm 结束文件,但文件实际上以 .oggtheora.ogv 和 .webmhd.webm 结尾 - 我最初在 HTML 中包含了这些确切的文件类型,但我得到了当它们是 .ogg 和 .webm 时,我得到的错误相同。干杯。

【问题讨论】:

  • 这仍然不起作用。如果我需要编辑 mime 类型,我该如何在 Godaddy 上做到这一点?我已经阅读过 .htcaccess 的内容,但这不只是针对 apache 的吗?

标签: html internet-explorer firefox video


【解决方案1】:

试试video for everybody

代码-

<!-- "Video For Everybody" http://camendesign.com/code/video_for_everybody -->
<video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360">
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" />
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm" />
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv" type="video/ogg" />
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="640" height="360">
    <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
    <param name="allowFullScreen" value="true" />
    <param name="wmode" value="transparent" />
    <param name="flashVars" value="config={'playlist':['http%3A%2F%2Fsandbox.thewikies.com%2Fvfe-generator%2Fimages%2Fbig-buck-bunny_poster.jpg',{'url':'http%3A%2F%2Fclips.vorwaerts-gmbh.de%2Fbig_buck_bunny.mp4','autoPlay':false}]}" />
    <img alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360" title="No video playback capabilities, please download the video below" />
</object>
</video>
<p>
<strong>Download video:</strong> <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4">MP4 format</a> | <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv">Ogg format</a> | <a href="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm">WebM format</a>
</p>

【讨论】:

    【解决方案2】:

    您需要将上述格式的视频放在正确的路径中,然后才能播放,尝试转换为特定格式并将其放在正确的路径中,然后尝试或尝试这样

    <video width="320" height="240" controls autoplay>
      <source src="movie.ogg" type="video/ogg">
      <source src="movie.mp4" type="video/mp4">
      <object data="movie.mp4" width="320" height="240">
        <embed width="320" height="240" src="movie.swf">
      </object>
    </video>
    

    【讨论】:

    • 我有 mp4、ogg 和 webm。我转换了视频并上传了所有 3 个视频,但它只能在 chrome 中运行。
    猜你喜欢
    • 1970-01-01
    • 2013-12-13
    • 2012-01-07
    • 2015-05-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多